Script to run 1 process and kill 2 services
-
swan_x
- Posts: 335
- Joined: 08 Oct 2009 12:27
Script to run 1 process and kill 2 services
Hi, i need 2 script:
1) run 1 service (aaa.exe)
2) kill 2 process (aaa.exe & another.exe)
I know taskkill for 1 process, But how to 2 kill process in the same script? And for run 1 service?
Tanxs a lot!
1) run 1 service (aaa.exe)
2) kill 2 process (aaa.exe & another.exe)
I know taskkill for 1 process, But how to 2 kill process in the same script? And for run 1 service?
Tanxs a lot!
-
highend
- Posts: 14942
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Script to run 1 processi and kill 2 services
1.) dos command: net start
2.) if you know how to kill one task, why don't you execute that command twice (second time with a different task name)?
2.) if you know how to kill one task, why don't you execute that command twice (second time with a different task name)?
One of my scripts helped you out? Please donate via Paypal
-
swan_x
- Posts: 335
- Joined: 08 Oct 2009 12:27
Re: Script to run 1 processi and kill 2 services
With taskkill aaa.exe,another.exe /F don't Work! And same with aaa.exe;another.exe.....
And to run 1 service?
And to run 1 service?
-
highend
- Posts: 14942
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Script to run 1 processi and kill 2 services
I wrote: execute that killtask command twice, not append a ",/;" and the other task name^^
Run service: dos command = net start... If you know how to execute a killtask dos command you can execute a net start <service name> as well?
Run service: dos command = net start... If you know how to execute a killtask dos command you can execute a net start <service name> as well?
One of my scripts helped you out? Please donate via Paypal
-
swan_x
- Posts: 335
- Joined: 08 Oct 2009 12:27
Re: Script to run 1 processi and kill 2 services
Ok, i got confused!
Net start work, But not on my specific service (Apple mobile service)... I have try But have a error (name of service invalid)
For kill my 2 process now i try!
Net start work, But not on my specific service (Apple mobile service)... I have try But have a error (name of service invalid)
For kill my 2 process now i try!
-
swan_x
- Posts: 335
- Joined: 08 Oct 2009 12:27
Re: Script to run 1 processi and kill 2 services
I have try: net start appleservice.exe and don't Work...
net service C:Program/dghjj/..../appleservice.exe and don't work.....
For taskkill i have try service one.exe,service to.exe and don't Work.....
net service C:Program/dghjj/..../appleservice.exe and don't work.....
For taskkill i have try service one.exe,service to.exe and don't Work.....
-
FluxTorpedoe
- Posts: 906
- Joined: 05 Oct 2011 13:15
Re: Script to run 1 processi and kill 2 services
You have to use the "real name" of the service, and not its filename, e.g.:swan_x wrote:I have try: net start appleservice.exe and don't Work...
Code: Select all
net start "Apple Mobile Device"
// Or e.g. straight from XYplorer’s address bar:
::run "%windir%\system32\net.exe start ""Apple Mobile Device""";highend wrote:I wrote: execute that killtask command twice, not append a ",/;" and the other task name^^
Hem Hem…swan_x wrote:For taskkill i have try service one.exe,service to.exe and don't Work.....
Appending a coma won’t get you much further!
As highend mentioned, what would be the problem of running the command twice — meaning, running it once on its own line, then running it once again (on another line) with the second task name?
Hope this helps,
Flux
• Scripts: Session Manager
| SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...
-
swan_x
- Posts: 335
- Joined: 08 Oct 2009 12:27
Re: Script to run 1 processi and kill 2 services
Tanxs for help!
Ok for net start, now i try.
For taskkill, i want at once, kill 2 process....
But if i write taskkill one.exe,second.exe not Work!
Only taskkill one.exe Work, But not togheter.....
Please write one example of correct syntax for kill at once 2 process....
Ok for net start, now i try.
For taskkill, i want at once, kill 2 process....
But if i write taskkill one.exe,second.exe not Work!
Only taskkill one.exe Work, But not togheter.....
Please write one example of correct syntax for kill at once 2 process....
-
FluxTorpedoe
- Posts: 906
- Joined: 05 Oct 2011 13:15
Re: Script to run 1 processi and kill 2 services
Example using taskkill with the processes filename, to force kill chrome and notepad:
Code: Select all
taskkill /F /IM chrome.exe /IM notepad.exe• Scripts: Session Manager
| SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...
-
swan_x
- Posts: 335
- Joined: 08 Oct 2009 12:27
Re: Script to run 1 processi and kill 2 services
Tanxs Flux! I understand.
But for start Apple service, net start Apple mobile service don't work....the service don't start...
And even with windir/system32.....net start Apple service don't start....why?
But for start Apple service, net start Apple mobile service don't work....the service don't start...
And even with windir/system32.....net start Apple service don't start....why?
-
highend
- Posts: 14942
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Script to run 1 processi and kill 2 services
Use quotation marks for the service name or even better, the real service name?
One of my scripts helped you out? Please donate via Paypal
-
FluxTorpedoe
- Posts: 906
- Joined: 05 Oct 2011 13:15
Re: Script to run 1 processi and kill 2 services
You need to use the exact name of the service as it is listed in your system.
Look for the name in the services console.
"Start" button > ("Run", or in the Find field) > type "services.msc" > Enter > Read the "Name" column to find your service.
You can also check its status (and dependencies) there.
Edit: highend beat me to it…
Look for the name in the services console.
"Start" button > ("Run", or in the Find field) > type "services.msc" > Enter > Read the "Name" column to find your service.
You can also check its status (and dependencies) there.
Edit: highend beat me to it…
• Scripts: Session Manager
| SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...
-
swan_x
- Posts: 335
- Joined: 08 Oct 2009 12:27
Re: Script to run 1 process and kill 2 services
Yes I have write the exact name of the service, but don't run....
Only run if I go to services on them run it manually.....
Only run if I go to services on them run it manually.....
-
highend
- Posts: 14942
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Script to run 1 process and kill 2 services
Then show the real script and it's output when it's executed?
One of my scripts helped you out? Please donate via Paypal
-
swan_x
- Posts: 335
- Joined: 08 Oct 2009 12:27
Re: Script to run 1 process and kill 2 services
For kill 2 my service it's ok!! Work!
For start my Apple service I don't have a error message, simply the service not run!
For start my Apple service I don't have a error message, simply the service not run!
XYplorer Beta Club