Jump to content

Recommended Posts

Posted

How do I get a service corresponding to the process PID number? exp:

I want to get the "DcomLaunch" and "TermService" service corresponding to the svchost.exe process's PID. How will i to do ? thanks

Posted

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.

Posted

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)
Posted

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

Posted

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

If above is valid you can use _RunDOS

thanks ,it's work in the xp system ,Can you tell me how to convert it with _RunDOS ? I'm the Novice..

Posted

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.

Posted

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.

Posted

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

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
×
×
  • Create New...