Call SetupBatcher from the command line to run commands on remote machines
Top  Previous  Next


Notice: SetupBatcher can NOT be started from the command line in the personal license version.

Save the below script as "remote.cnu".

[Settings_Begin]
BatchSettings.Delimiter=TAB
BatchSettings.MarkerCol=4
[Settings_End]

[Batch_Begin]
// The below line will be replaced
DOSR \\edu12,0,dir c:
// Stop the remote admin service        
Service.Admin.Stop      
[Batch_End]


Save the below batch file as "remote.bat".

admwin.exe /SB remote.cnu /r batch,DOSR,DOSR %1,0,%2
if %errorlevel% EQU 0 goto OK

:ERROR
type batch.log
goto END

:OK
echo All OK!

:END
pause


Start a command prompt and call "remote.bat" with this syntax: "Remote \\computername command" - example:

Remote \\wks02 notepad.exe

This happens when "remote.bat" is called

·AdmWin starts and loads the script "Remote.cnu"  
·The "DOSR" line in the batch section is replaced with "DOSR \\FirstCommandParameter,0,SecondCommandParameter"  
·The SetupBatcher script starts:  
·The remote admin service is installed and started if needed  
·The command is executed on the remote machine  
·The remote admin service is stopped  
·The batch file checks error level, if there are errors the file "batch.log" is echoed (SetupBatcher creates the file batch.log when a script is executed from the command line)