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 

Problem with Run and Process, WaitClose

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



Joined: 18 Jan 2010
Posts: 193
Location: Switzerland

PostPosted: Thu Feb 25, 2010 1:39 pm    Post subject: Problem with Run and Process, WaitClose Reply with quote

Hello
I have a problem with Process, WaitClose.
The process is not killed within 5 seconds, why?


Code:
Run,  "%comspec% /c test.txt , , min, NEWPID
msgbox %NEWPID%
Process, WaitClose, %NewPID%, 5


msgbox : cmd.exe but test.exe isn't kill


Code:
Run, test.exe, , , NEWPID
msgbox %NEWPID%
Process, WaitClose, %NewPID%, 5


test.exe isn't kill

Process syntax

Thank for you help.

Acris
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Thu Feb 25, 2010 1:57 pm    Post subject: Reply with quote

Example #2 suggest that WaitClose doesn't close and wait - you have to use WinClose (on a window) or Process,Close to make the actual kill and then Process,WaitClose to check whether it did close.
_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
Acris



Joined: 18 Jan 2010
Posts: 193
Location: Switzerland

PostPosted: Thu Feb 25, 2010 3:56 pm    Post subject: Reply with quote

Hello,

Process,Close doesn't work too

i'll try winclose

winclose suggests that I know the name of the window but this is not the case.
it can be anything

but I am still trying

MY Program.exe is a batch convert to exe (with bat2exe converter) (run cmd.exe)

It creates temporary files but remove them as soon as you close the window with the red cross
Back to top
View user's profile Send private message
Display posts from previous:   
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