tetotaly Posted July 12, 2007 Share Posted July 12, 2007 (edited) When I close a CMD-process by its PID (which I read from a file) under Vista, the process disappears from the taskmanager's tasklist, but the cmd window stays open and ist completely usable, i.e. the process running in it is still active. Under WinXP the same script works properly and closes the window and the process. Did I do sth wrong? I would be very happy about any suggestions and ideas. Thanks - tetotaly $file = FileOpen ( "pid.txt", 0 ) $PID = FileRead( $file,4) FileClose($file) ProcessClose ( $PID) edit: I'm using AutoIt v3.2.4.9 and the script runs as an *.exe file with admin properties. Edited July 12, 2007 by tetotaly Link to comment Share on other sites More sharing options...
Bert Posted July 12, 2007 Share Posted July 12, 2007 What happens when you do a winkill on the window in question? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
tetotaly Posted July 12, 2007 Author Share Posted July 12, 2007 How can I kill the window by its PID? Unfortunately the title isn't distinct and I don't want to close te other CMDs. Link to comment Share on other sites More sharing options...
MHz Posted July 12, 2007 Share Posted July 12, 2007 How can I kill the window by its PID? Unfortunately the title isn't distinct and I don't want to close te other CMDs.Unfortunately for you, FileRead does not return a Process Identifier number unless the PID is stored within the file. You maybe able to search the forum for a UDF named something like "WinTitleByPID" or similar. Members have created UDFs already to handle these kind of issues. Link to comment Share on other sites More sharing options...
tetotaly Posted July 13, 2007 Author Share Posted July 13, 2007 Yes, I store the PID in the file. I found a solution now with a combination of ProcessClose and WinKill. But thanks anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now