Following is KIX script for install RCMD on target workstations and then use RCMD to install or execute any command over target PC's.(1): open (1,C:\WorkStations.txt) ;where you can place all workstation that you want execute any command over them.
$temp = readline(1)
DO
$PClist = WRITEPROFILESTRING("C:\RCMD.ini","Machine List", $ temp , " INCLUDE")
;previous step will read PC names from your TXT file and this step will send them to RCMD.INI under Machine List.
$temp = readline(1)
until @error <> 0 OR $temp = "The command completed successfully."
close(1)
;from your PC (will be called source) you should have Service.exe then--
SHELL "%COMSPEC% /E:1024 /C C:\Service.exe /install /start /a /l C:\RCMD.ini"
? @serror
; This step might be enough to install and start the service but in some cases you might need to start it 2 times, therefore ---
SHELL "%COMSPEC% /E:1024 /C C:\Rservice.exe /start /a /l E:\ServicePack\SAP1.ini"
? @Serror
;please read carefully in RCMD help file about /A and RCMD INI sections.
SHELL '%COMSPEC% /E:1024 /C net use B: \\Server name\Shared /user:user with Admin privileges over target PC’s Password'
;Net Use will map all your target to Server name & shared where you keep your software that you want to install over target PC’s.
SHELL '%COMSPEC% /E:1024 /C B:\my software.exe
SHELL '%COMSPEC% /E:1024 /C NET USE B: /delete'
In some cases after net use make the new map drive RCMD can’t use this new map to run your EXE over the target PC’s(I faced this problem with SAP front end where the SAP folder that need to be placed on the server/shared is 185 MB) however if you faced such problem or in implementing any steep of the previous steps I will try to help.
Thak you.
Note: I used the previous script (with some additional code) to install many software over 200 PC’s for the last 9 months, however I don’t think I would be able to do any of this without Bryce support where I learned a lot from his scripts either his script about SU or any other scripts.
------------------