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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -