Bat to script
Bat to script
I have .bat file to terminate 3 process and run one little.exe to clean my empty
run"cmd /c TASKKILL /IM adb.exe /f; cmd /c TASKKILL /IM SynciosDeviceService.exe /f; cmd /c TASKKILL /IM audiodg.exe /f; cmd /c TASKKILL /IM WmiPrvSE.exe /f; D:\apps\EmptyRecycleBin.exe /q"
Then, how to run this on script file??
run"cmd /c TASKKILL /IM adb.exe /f; cmd /c TASKKILL /IM SynciosDeviceService.exe /f; cmd /c TASKKILL /IM audiodg.exe /f; cmd /c TASKKILL /IM WmiPrvSE.exe /f; D:\apps\EmptyRecycleBin.exe /q"
Then, how to run this on script file??
Re: Bat to script
Code: Select all
run """cmd"" /c TASKKILL /IM adb.exe /f";
// Same procedure for the next two...
run """D:\apps\EmptyRecycleBin.exe"" /q";
One of my scripts helped you out? Please donate via Paypal
Re: Bat to script
Ok highend, I’ve understand. Tanxs for your support! Now i try... bye
Re: Bat to script
I’ve try... the syntax is correct, the script run....
But the 3 process not kill and same my little program (empty recycle) don’t run...
Instead with my .bat file process it’s terminated and same my little prog...
Why the script not kill process??
But the 3 process not kill and same my little program (empty recycle) don’t run...
Instead with my .bat file process it’s terminated and same my little prog...
Why the script not kill process??
Re: Bat to script
Inappropriate permissions?
Killing a running adb instance works fine with that syntax
Killing a running adb instance works fine with that syntax
One of my scripts helped you out? Please donate via Paypal
Re: Bat to script
Ok..but only this...i repeat with bat file all work correctly...
Re: Bat to script
And?
I don't know how the .bat file is started and with which permissions
I don't know with which permissions XY is running
...
I don't know how the .bat file is started and with which permissions
I don't know with which permissions XY is running
...
One of my scripts helped you out? Please donate via Paypal
Re: Bat to script
Not sure what you are doing wrong, but if you are interested, a tip for troubleshooting is to run it with a /k instead like below, it is a quick & easy modification that shows if you are getting an error, if it is a permissions issue you should see "Reason: Access is denied."
I usually run taskkill without the CMD prefix, but for troubleshooting it is handy.
Code: Select all
run """%COMSPEC%"" /k taskkill /im ""adb.exe"" /f";
Re: Bat to script
@ jupe
tanxs to your reply, now I try
@ highend
No particular permission when run bat file... simply i have created with notepad, change extension from .txt to .bat then with assigned letter i run it from xy... simply that! and work fine!
When run same command with script, process not killed!!
tanxs to your reply, now I try
@ highend
No particular permission when run bat file... simply i have created with notepad, change extension from .txt to .bat then with assigned letter i run it from xy... simply that! and work fine!
When run same command with script, process not killed!!
Re: Bat to script
ok now work fine! but ....
afetr many attemps, correct syntax not required // into single process:
run """cmd"" /c TASKKILL /IM adb.exe /f"; run """cmd"" /c TASKKILL /IM SynciosDeviceService.exe /f"; run """cmd"" /c TASKKILL /IM WmiPrvSE.exe /f"; run """D:\apps\EmptyRecycleBin.exe"" /q"
but this command open (and close) 3 windows to terminate 3 single killing process... how to have only one single window to kill all process??
afetr many attemps, correct syntax not required // into single process:
run """cmd"" /c TASKKILL /IM adb.exe /f"; run """cmd"" /c TASKKILL /IM SynciosDeviceService.exe /f"; run """cmd"" /c TASKKILL /IM WmiPrvSE.exe /f"; run """D:\apps\EmptyRecycleBin.exe"" /q"
but this command open (and close) 3 windows to terminate 3 single killing process... how to have only one single window to kill all process??
Re: Bat to script
And because of what?...ok now work fine!
taskkill supports MULTIPLE /IM switches in ONE line...
and the script command run can hide a dos box for
emptyrecyclebin.exe (if it actually invokes one)
One of my scripts helped you out? Please donate via Paypal
Re: Bat to script
Now work fine because before of my post (with // into process) the script not killed process!
Now, without//, all process is killed!
But, i repeat, with latest syntax all work but I have 3 windows of cmd.... it’s no possible (how to?) have only one cmd to kill 3 process together?
Now, without//, all process is killed!
But, i repeat, with latest syntax all work but I have 3 windows of cmd.... it’s no possible (how to?) have only one cmd to kill 3 process together?
Re: Bat to script
Em, the answer is already in my last post?
One of my scripts helped you out? Please donate via Paypal
Re: Bat to script
You don’t understand me!
I want the correct string, text, script to run 3 kill process into 1 cmd...
Repeat with my post I have 3 windows... it’s more difficult for you write correct script for this?
I’m not able and I cannot do this...write, or if you don’t want help me, please don’t reply, I wait another generous user.....
I want the correct string, text, script to run 3 kill process into 1 cmd...
Repeat with my post I have 3 windows... it’s more difficult for you write correct script for this?
I’m not able and I cannot do this...write, or if you don’t want help me, please don’t reply, I wait another generous user.....
Re: Bat to script
Something like this should work as a one liner:
In the future if you have trouble writing scripts, but already have a working batch file, it might be better for you to keep the batch file and just run it like this:
Code: Select all
run """%COMSPEC%"" /c TASKKILL /IM adb.exe /IM SynciosDeviceService.exe /IM WmiPrvSE.exe /f",,,0;
Code: Select all
runq "c:\path\to\a batch\file\that works.bat";