| View previous topic :: View next topic |
| Author |
Message |
Hester
Joined: 07 Mar 2005 Posts: 27
|
Posted: Sat Mar 19, 2005 4:04 am Post subject: How do i exit game.exe windows process? |
|
|
I am tring to exit a game.exe windows process with a command.
Please help.
example code:
Exit, game.exe, C:\programs
Last edited by Hester on Sat Mar 19, 2005 2:47 pm; edited 1 time in total |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Sat Mar 19, 2005 5:17 am Post subject: |
|
|
| I think the WinClose command is what you're looking for. You may also want to look at the Quick-Start Tutorial if you haven't already, since it's a great resource for beginners. |
|
| Back to top |
|
 |
Hester
Joined: 07 Mar 2005 Posts: 27
|
Posted: Sat Mar 19, 2005 2:50 pm Post subject: |
|
|
| I dont want to close the window. i want to close the windows process. the window may have a different name than game.exe. |
|
| Back to top |
|
 |
hs2
Joined: 25 Feb 2005 Posts: 11 Location: Germany
|
|
| Back to top |
|
 |
Serenity
Joined: 08 Nov 2004 Posts: 1025
|
Posted: Sat Mar 19, 2005 3:14 pm Post subject: |
|
|
Hester, if you have the process name or PID you can use Process to close instead. _________________ "Anything worth doing is worth doing slowly." - Mae West
 |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Sat Mar 19, 2005 5:52 pm Post subject: |
|
|
| Yes, you can use Process, but I'd highly recommmend looking for other ways to solve your problem first. Acting directly on a process is harsh and should be avoided, especially for repeated use. Would you mind telling us what problem you're trying to solve? |
|
| Back to top |
|
 |
Hester
Joined: 07 Mar 2005 Posts: 27
|
Posted: Sat Mar 19, 2005 6:55 pm Post subject: |
|
|
I am trying to auto launch a script with another and exit the same way.
Script 1 turns on and off script 2. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Mar 19, 2005 7:01 pm Post subject: |
|
|
In recent versions, you can use ahk_pid to close the window associated with a process: | Code: | Process, Exist, game.exe
if ErrorLevel ; The process exists.
WinClose, ahk_pid %ErrorLevel% | The above is usually preferable to "Process Close" because "Process Close" terminates the process, which is not as friendly as closing its window. |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Sat Mar 19, 2005 8:24 pm Post subject: |
|
|
| Also, you can automatically get the PID of anything you run from a script. See the Run documentation for more info. |
|
| Back to top |
|
 |
|