windows - Batch file doesn't continue until after I exit psexec remote connection -
i'm trying make batch file run script on remote server. if enter commands below in cmd prompt seperately works fine seems hang after enter psexec commands. continues rest of batch file when exit psexec remote connection. rest of commands run on local computer(which don't want). have ideas or suggestions?
psexec \\servname -u domain\username -p password cmd.exe pause cd c:\users\username pause cscript \\networkname\filepath\blanktest.vbs
you can bundle commands 1 batch file , execute using 1 line:
psexec \\servname -u domain\username -p password cmd.exe -c mybatchfile.bat
that cause file copied remote machine first. alternatively if have problems that, copy file first, execute it; note different parameter, /c
vs -c
:
copy mybatchfile.bat \\servname\admin$ psexec \\servname -u domain\username -p password cmd.exe /c mybatchfile.bat
Comments
Post a Comment