issue with psexec not closing after execution
Posted: 2021-Jul-14, 5:53 pm
03 Oct 2015 23:20
jester3k
Hello all
very new to this so i hope this is the correct place
I have a command that needs to this code on 10 different networked pcs
first bat file changes the background color the second code runs video files
for some reason it does not execute the second line unless I use "start cmd /c"
now after it executes the second line it leaves me with an open psexec "copyright window"
tried running
at the end but CMD stays open with the 10 copyright windows
how can I either close the copyright or stop CMD after executing the two commands on all 10 pcs?
----------------------------
#2 04 Oct 2015 17:06
Batcher
Jester3k I am also having a similar problem taskkill /I'm has only been able to kill windows explorer.exe and nothing else I am still looking for a solution.
----------------------------
#3 04 Oct 2015 17:25
jester3k
----------------------------
#4 04 Oct 2015 18:38
Batcher
try this jester3k
This will kill cmd and should kill all of its child processes
Last edited by Batcher (04 Oct 2015 18:44)
----------------------------
#5 04 Oct 2015 21:19
jester3k
I treat the machine im executing from as a remote pc
i had to use 7 lines of random code to sort of delay the execution of the talk kill since it executed in the middle of the execution of the bat files
if someone has something more elegant id be glad to try it
----------------------------
#6 05 Oct 2015 04:55
foxidrive
Is there are reason you are using two batch scripts, instead of launching one batch script to perform the tasks?
----------------------------
#7 05 Oct 2015 11:17
jester3k
is there a script i can run on the first on that runs the second one?
----------------------------
#8 06 Oct 2015 11:39
bluesxman
You could try this:
cmd | *sh | ruby | chef
----------------------------
#9 14 Oct 2015 16:38
ronalehm
intenta con esto:
name: equipo remoto
PsExec.exe \\name -e cmd /C \\name\c$\ojo\install.bat
se ejecuta el bat, en la ruta c:\ojo
install.bat
Offline
translation--
try this:
name: remote computer
PsExec.exe \\name -e cmd /C \\name\c$\eye\install.bat
the bat is executed, in the path c:\eye
----------------------------
jester3k
Hello all
very new to this so i hope this is the correct place
I have a command that needs to this code on 10 different networked pcs
Code: Select all
psexec \\11.11.111.111 -u Administrator -p password -i c:\CodeVIP\black.bat
start cmd /c psexec \\11.11.111.111 -u Administrator -p password -i D:\INETB\start.bat
for some reason it does not execute the second line unless I use "start cmd /c"
now after it executes the second line it leaves me with an open psexec "copyright window"
tried running
Code: Select all
TASKKILL /IM cmd.exe
how can I either close the copyright or stop CMD after executing the two commands on all 10 pcs?
----------------------------
#2 04 Oct 2015 17:06
Batcher
Jester3k I am also having a similar problem taskkill /I'm has only been able to kill windows explorer.exe and nothing else I am still looking for a solution.
----------------------------
#3 04 Oct 2015 17:25
jester3k
are you trying to end it remotely or locallyBatcher wrote:
Jester3k I am also having a similar problem taskkill /I'm has only been able to kill windows explorer.exe and nothing else I am still looking for a solution.
----------------------------
#4 04 Oct 2015 18:38
Batcher
try this jester3k
Code: Select all
taskkill /IM cmd.exe /T /F
Last edited by Batcher (04 Oct 2015 18:44)
----------------------------
#5 04 Oct 2015 21:19
jester3k
tried this and it didn't do anything so i sort of found a work aroundBatcher wrote:
try this jester3k
taskkill /IM cmd.exe /T /F
This will kill cmd and should kill all of its child processes
I treat the machine im executing from as a remote pc
Code: Select all
psexec \\localpc -u administrator -p password -i TASKKILL /IM cmd.exe
if someone has something more elegant id be glad to try it
----------------------------
#6 05 Oct 2015 04:55
foxidrive
Is there are reason you are using two batch scripts, instead of launching one batch script to perform the tasks?
----------------------------
#7 05 Oct 2015 11:17
jester3k
The second one is not mine, i cnat really modify it....foxidrive wrote:
Is there are reason you are using two batch scripts, instead of launching one batch script to perform the tasks?
is there a script i can run on the first on that runs the second one?
----------------------------
#8 06 Oct 2015 11:39
bluesxman
You could try this:
Code: Select all
start cmd /c psexec \\11.11.111.111 -u Administrator -p password -i cmd /c start "" D:\INETB\start.bat
----------------------------
#9 14 Oct 2015 16:38
ronalehm
bluesxman wrote:
You could try this:
Code: Select all
start cmd /c psexec \\11.11.111.111 -u Administrator -p password -i cmd /c start "" D:\INETB\start.bat
intenta con esto:
name: equipo remoto
PsExec.exe \\name -e cmd /C \\name\c$\ojo\install.bat
se ejecuta el bat, en la ruta c:\ojo
install.bat
Offline
translation--
try this:
name: remote computer
PsExec.exe \\name -e cmd /C \\name\c$\eye\install.bat
the bat is executed, in the path c:\eye
----------------------------