AutoHotkey Community

It is currently May 26th, 2012, 6:28 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: March 19th, 2005, 4:04 am 
Offline

Joined: March 7th, 2005, 4:09 am
Posts: 27
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 March 19th, 2005, 2:47 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 5:17 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 2:50 pm 
Offline

Joined: March 7th, 2005, 4:09 am
Posts: 27
I dont want to close the window. i want to close the windows process. the window may have a different name than game.exe.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 2:56 pm 
Offline

Joined: February 25th, 2005, 5:05 pm
Posts: 11
Location: Germany
Well, maybe just using a shotgun :)

Code:
Run, PsKill.exe game.exe

http://www.sysinternals.com/ntw2k/freeware/pstools.shtml


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 3:14 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 5:52 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 6:55 pm 
Offline

Joined: March 7th, 2005, 4:09 am
Posts: 27
I am trying to auto launch a script with another and exit the same way.

Script 1 turns on and off script 2.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 7:01 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2005, 8:24 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Also, you can automatically get the PID of anything you run from a script. See the Run documentation for more info.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bobbysoon, Exabot [Bot], JSLover, kkkddd1, Tipsy3000, Yahoo [Bot] and 69 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group