Jump to content

The process PID and service questions


LzY
 Share

Recommended Posts

If you have 'tasklist' available on your PC, you can use that to quickly output the services associated with each PID (with the '/svc' switch), which you can then parse.

You could also try out the Windows Services UDF by GEOSoft.

Link to comment
Share on other sites

If you have 'tasklist' available on your PC, you can use that to quickly output the services associated with each PID (with the '/svc' switch), which you can then parse.

You could also try out the Windows Services UDF by GEOSoft.

thanks , I have the batch for that ,How do I convert it to au3 ? thanks !

for /f "tokens=2 delims= " %%a in ('tasklist/svc^|find ^"TermService^"') do (taskkill /pid %%a /f)
Link to comment
Share on other sites

thanks , I have the batch for that ,How do I convert it to au3 ? thanks !

for /f "tokens=2 delims= " %%a in ('tasklist/svc^|find ^"TermService^"') do (taskkill /pid %%a /f)

Why would you want to kill all scheduled tasks in Vista?

If above is valid you can use _RunDOS

Link to comment
Share on other sites

Why would you want to kill all scheduled tasks in Vista?

If above is valid you can use _RunDOS

for /f "tokens=2 delims= " %%a in ('tasklist/svc^|find ^"TermService^"') do (taskkill /pid %%a /f)

The batch means to find the 'TermService' service corresponding to the process PID from all the processes , and kill it.

Link to comment
Share on other sites

You can run the command prompt from AutoIt and put that line without doubling up on the %'s (batch files need two %'s in 'for' statements, direct commands don't).

Try something like this:

Run(@ComSpec&' /c for /f "tokens=2 delims= " %a in (''tasklist/svc^|find ^"TermService^"'') do (taskkill /pid %a /f)')

You might replace /c with /k to ensure it's working, and then hide the window with @SW_HIDE.

Link to comment
Share on other sites

You can run the command prompt from AutoIt and put that line without doubling up on the %'s (batch files need two %'s in 'for' statements, direct commands don't).

Try something like this:

Run(@ComSpec&' /c for /f "tokens=2 delims= " %a in (''tasklist/svc^|find ^"TermService^"'') do (taskkill /pid %a /f)')

You might replace /c with /k to ensure it's working, and then hide the window with @SW_HIDE.

thank you very match......
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...