Page 1 of 2
Script to run 1 process and kill 2 services
Posted: 15 Oct 2015 18:24
by swan_x
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!
Re: Script to run 1 processi and kill 2 services
Posted: 15 Oct 2015 20:31
by highend
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)?
Re: Script to run 1 processi and kill 2 services
Posted: 16 Oct 2015 11:45
by swan_x
With taskkill aaa.exe,another.exe /F don't Work! And same with aaa.exe;another.exe.....
And to run 1 service?
Re: Script to run 1 processi and kill 2 services
Posted: 16 Oct 2015 12:06
by highend
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?
Re: Script to run 1 processi and kill 2 services
Posted: 16 Oct 2015 17:37
by swan_x
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!
Re: Script to run 1 processi and kill 2 services
Posted: 17 Oct 2015 11:01
by swan_x
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.....
Re: Script to run 1 processi and kill 2 services
Posted: 17 Oct 2015 11:14
by FluxTorpedoe
swan_x wrote:I have try: net start appleservice.exe and don't Work...
You have to use the "real name" of the service, and not its filename, e.g.:
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^^
swan_x wrote:For taskkill i have try service one.exe,service to.exe and don't Work.....
Hem Hem…
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
Re: Script to run 1 processi and kill 2 services
Posted: 17 Oct 2015 11:41
by swan_x
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....
Re: Script to run 1 processi and kill 2 services
Posted: 17 Oct 2015 12:05
by FluxTorpedoe
Example using taskkill with the processes filename, to force kill chrome and notepad:
Code: Select all
taskkill /F /IM chrome.exe /IM notepad.exe
Re: Script to run 1 processi and kill 2 services
Posted: 19 Oct 2015 10:59
by swan_x
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?
Re: Script to run 1 processi and kill 2 services
Posted: 19 Oct 2015 11:28
by highend
Use quotation marks for the service name or even better, the real service name?
Re: Script to run 1 processi and kill 2 services
Posted: 19 Oct 2015 11:46
by FluxTorpedoe
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…

Re: Script to run 1 process and kill 2 services
Posted: 19 Oct 2015 12:59
by swan_x
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.....
Re: Script to run 1 process and kill 2 services
Posted: 19 Oct 2015 13:10
by highend
Then show the real script and it's output when it's executed?
Re: Script to run 1 process and kill 2 services
Posted: 19 Oct 2015 18:11
by swan_x
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!