AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do i exit game.exe windows process?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Hester



Joined: 07 Mar 2005
Posts: 27

PostPosted: Sat Mar 19, 2005 4:04 am    Post subject: How do i exit game.exe windows process? Reply with quote

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
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Sat Mar 19, 2005 5:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Hester



Joined: 07 Mar 2005
Posts: 27

PostPosted: Sat Mar 19, 2005 2:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
hs2



Joined: 25 Feb 2005
Posts: 11
Location: Germany

PostPosted: Sat Mar 19, 2005 2:56 pm    Post subject: Reply with quote

Well, maybe just using a shotgun Smile

Code:
Run, PsKill.exe game.exe

http://www.sysinternals.com/ntw2k/freeware/pstools.shtml
Back to top
View user's profile Send private message
Serenity



Joined: 08 Nov 2004
Posts: 1025

PostPosted: Sat Mar 19, 2005 3:14 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Sat Mar 19, 2005 5:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hester



Joined: 07 Mar 2005
Posts: 27

PostPosted: Sat Mar 19, 2005 6:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sat Mar 19, 2005 7:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Sat Mar 19, 2005 8:24 pm    Post subject: Reply with quote

Also, you can automatically get the PID of anything you run from a script. See the Run documentation for more info.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group