Relaunching Discord Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
montie
Posts: 7
Joined: 01 Dec 2022, 16:13

Relaunching Discord

10 Apr 2024, 15:21

Occasionally, Discord glitches on my PC. Refreshing it doesn't fix it, it needs to be really closed and then relaunched.

Code: Select all

#IfWinActive, ahk_exe discord.exe
^+r::									; Ctrl+Shift+r - Close and relaunch Discord
WinClose, ahk_exe Discord.exe
Sleep 1000
Process, Close, ahk_exe Discord.exe
Process, WaitClose, ahk_exe Discord.exe, 5
Run, Discord.lnk, C:\Users\Montie\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Discord Inc
Return
It just closes the Window then relaunch. I can't get it to completely end process before relaunching. What should I do?
montie
Posts: 7
Joined: 01 Dec 2022, 16:13

Re: Relaunching Discord  Topic is solved

10 Apr 2024, 22:56

I got it. I just had to remove ahk_exe

Here's the updated code:

Code: Select all

#IfWinActive, ahk_exe discord.exe
^+r::									; Ctrl+Shift+r - Close and relaunch Discord
Process, Close, Discord.exe
Sleep 500
Run, Discord.lnk, C:\Users\Montie\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Discord Inc
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 98 guests