Bat file to create another bat file.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Docfxit
Posts: 60
Joined: 12 Nov 2015 12:42

Re: Bat file to create another bat file.

#16 Post by Docfxit » 27 Dec 2019 12:10

It would be nice if the CMD window on the remote PC would run minimized.

This runs with the CMD window open:

Code: Select all

c:\batch\psexec.exe @"C:\Batch\PushFileAndRunItComputerList.txt"  -u MyUser -p MyPassword -i -c -v "C:\Dnload\9xAddons\Macrium\UpdateMacriumRun.bat"
I tried adding cmd to it so it would minimize:

Code: Select all

c:\batch\psexec.exe @"C:\Batch\PushFileAndRunItComputerList.txt"  -u MyUser -p MyPassword -i -c -v cmd.exe /c start /min "C:\Dnload\9xAddons\Macrium\UpdateMacriumRun.bat"
It doesn't like how I added it.

Does anyone have any suggestions?

Thanks,
Docfxit

bakemonogatari
Posts: 21
Joined: 08 Jul 2019 05:22

Re: Bat file to create another bat file.

#17 Post by bakemonogatari » 27 Dec 2019 13:53

are you sure you need -i ? try -d instead.

Docfxit
Posts: 60
Joined: 12 Nov 2015 12:42

Re: Bat file to create another bat file.

#18 Post by Docfxit » 27 Dec 2019 14:23

bakemonogatari wrote:
27 Dec 2019 13:53
are you sure you need -i ? try -d instead.
With -d instead of -i
On the PC I start the Psexec from it shows:
cmd.exe started on 192.168.168.34 with process ID 7152.

But nothing runs on that pc.

Code: Select all

c:\batch\psexec.exe @"C:\Batch\PushFileAndRunItComputerList.txt"  -u MyUser -p MyPassword -d -c -v cmd.exe /c start /min "C:\Dnload\9xAddons\Macrium\UpdateMacriumRun.bat"
Thanks,

Docfxit

bakemonogatari
Posts: 21
Joined: 08 Jul 2019 05:22

Re: Bat file to create another bat file.

#19 Post by bakemonogatari » 27 Dec 2019 17:39

i'm using a different command line and it works for me.
PsExec.exe \\!RemoteComputer! -h -accepteula -d %SystemDrive%\Batch\RemoteScript.bat

Post Reply