issue with psexec not closing after execution

Microsoft Windows
Post Reply
User avatar
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Contact:

issue with psexec not closing after execution

Post by MigrationUser »

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

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

Code: Select all

TASKKILL /IM cmd.exe
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
Batcher 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.
are you trying to end it remotely or locally

----------------------------

#4 04 Oct 2015 18:38
Batcher

try this jester3k

Code: Select all

taskkill /IM cmd.exe /T /F
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
Batcher wrote:

try this jester3k
taskkill /IM cmd.exe /T /F

This will kill cmd and should kill all of its child processes
tried this and it didn't do anything so i sort of found a work around
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
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
foxidrive wrote:

Is there are reason you are using two batch scripts, instead of launching one batch script to perform the tasks?
The second one is not mine, i cnat really modify it....
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 
cmd | *sh | ruby | chef

----------------------------

#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

----------------------------
User avatar
Simon Sheppard
Posts: 190
Joined: 2021-Jul-10, 7:46 pm
Contact:

Re: issue with psexec not closing after execution

Post by Simon Sheppard »

Im late to the party but you may just need to use psexec -accepteula to suppress the copyright message.
Post Reply