You are not logged in.

#1 03 Oct 2015 23:20

jester3k
New Member
Registered: 03 Oct 2015
Posts: 4

issue with psexec not closing after execution

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

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

Offline

#2 04 Oct 2015 17:06

Batcher
Member
Registered: 20 Jul 2015
Posts: 56

Re: issue with psexec not closing after execution

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.

Offline

#3 04 Oct 2015 17:25

jester3k
New Member
Registered: 03 Oct 2015
Posts: 4

Re: issue with psexec not closing after execution

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

Offline

#4 04 Oct 2015 18:38

Batcher
Member
Registered: 20 Jul 2015
Posts: 56

Re: issue with psexec not closing after execution

try this jester3k
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)

Offline

#5 04 Oct 2015 21:19

jester3k
New Member
Registered: 03 Oct 2015
Posts: 4

Re: issue with psexec not closing after execution

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

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

Offline

#6 05 Oct 2015 04:55

foxidrive
Member
Registered: 04 Apr 2013
Posts: 339

Re: issue with psexec not closing after execution

Is there are reason you are using two batch scripts, instead of launching one batch script to perform the tasks?

Offline

#7 05 Oct 2015 11:17

jester3k
New Member
Registered: 03 Oct 2015
Posts: 4

Re: issue with psexec not closing after execution

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?

Offline

#8 06 Oct 2015 11:39

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 1,129

Re: issue with psexec not closing after execution

You could try this:

start cmd /c psexec \\11.11.111.111 -u Administrator -p password -i cmd /c start "" D:\INETB\start.bat 

cmd | *sh | ruby | chef

Offline

#9 14 Oct 2015 16:38

ronalehm
New Member
Registered: 14 Oct 2015
Posts: 1

Re: issue with psexec not closing after execution

bluesxman wrote:

You could try this:

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

Board footer

Powered by