Jump to content

vista cmd window doesn't close


Recommended Posts

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 by tetotaly
Link to comment
Share on other sites

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.

:whistle:

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...