Jump to content

How to terminate processes?


Recommended Posts

I'm sorry if this is a rather newblie question, but is there a way to end processes using an AutoIt script directly, rather than using it to execute task manager and then sending the commands to terminate the processes? I'm working on a script that copies and deletes some files via run(@COMSPEC & '/k "...."', @WORKINGDIR, @SW_HIDE), and it keeps leaving LOTS of cmd.exe processes. Is there an easy way to automate their destruction?

Thanks.

Edited by Hollowpoint
Link to comment
Share on other sites

I'm sorry if this is a rather newblie question, but is there a way to end processes using an AutoIt script directly, rather than using it to execute task manager and then sending the commands to terminate the processes? I'm working on a script that copies and deletes some files via run(@COMSPEC & '/k "...."', @WORKINGDIR, @SW_HIDE), and it keeps leaving LOTS of cmd.exe processes. Is there an easy way to automate their destruction?

Thanks.

ProcessClose() can close processes, but you are better off using the /c switch with @ComSpec which will terminate it automatically once done rather then the /k switch which keeps @ComSpec open.

:P

Link to comment
Share on other sites

ProcessClose() can close processes, but you are better off using the /c switch with @ComSpec which will terminate it automatically once done rather then the /k switch which keeps @ComSpec open.

:P

Thanks. Wouldn't have thought of that.

Is there a section in the documentation with the parameters and switches for the various commands and macros?

Edited by Hollowpoint
Link to comment
Share on other sites

Thanks. Wouldn't have thought of that.

Is there a section in the documentation with the parameters and switches for the various commands and macros?

Your referring to @Comspec?, then bring up a command prompt and type cmd /?. For general help type help /? and items in the help list type item /?, replace item with the command for the information for it.

AutoIt3 switches are in the helpfile here.

:P

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...