Page 2 of 2

Re: Bat file to create another bat file.

Posted: 27 Dec 2019 12:10
by Docfxit
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

Re: Bat file to create another bat file.

Posted: 27 Dec 2019 13:53
by bakemonogatari
are you sure you need -i ? try -d instead.

Re: Bat file to create another bat file.

Posted: 27 Dec 2019 14:23
by Docfxit
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

Re: Bat file to create another bat file.

Posted: 27 Dec 2019 17:39
by bakemonogatari
i'm using a different command line and it works for me.
PsExec.exe \\!RemoteComputer! -h -accepteula -d %SystemDrive%\Batch\RemoteScript.bat