I am working on this batch file and i need some help to complete it... Here it is and what it does. First it would copy a file to a remote computer, using (pclist.txt), second it start the psexec on the remote computer and changes directory (windows/temp) folder. Fially it suppose to execute the commands "expand" and "dism" which those 2 commands i cant get to work. So everything works up to this line (for /F %%a in (pclist.txt) do psexec \\%%a\ cmd /k cd c:\windows\temp).
the next step is running the other 2 commands which i can't get to work, ive tried using the "&", but that doesn't work.
expand -f: *"Windows6.1-KB3192403-x86.msu" %TEMP%
dism /online /add-package /packagepath:c:\windows\temp\Windows6.1-KB3192403-86.cab /quiet /norestart
these 2 commands will not run, like i said the psexec runs and then changes directory to the windows/temp but nothing happens after that. Any help would be greatly appreciated. thanks all
----------------------------------------------------------------------------------------
@echo off
for /F "tokens=*" %%1 in (pclist.txt) do (
echo Copying files to %%1
MD "\\%%1\c$\targetfolder"
copy "c:\Users\Kris\Programs\Windows6.1-KB3192403-x86.msu"
"\\%%1\c$\windows\temp"
)
:::: End Copy ::::::
for /F %%a in (pclist.txt) do psexec \\%%a\ cmd /k cd c:\windows\temp &
type "expand -f: *"Windows6.1-KB3192403-x86.msu" %TEMP% &
do dism /online /add-package
/packagepath:c:\windows\temp\Windows6.1-KB3192403-86.cab /quiet /norestart
& pause
-----------------------------------------------------------------------------------------
the next step is running the other 2 commands which i can't get to work, ive tried using the "&", but that doesn't work.
expand -f: *"Windows6.1-KB3192403-x86.msu" %TEMP%
dism /online /add-package /packagepath:c:\windows\temp\Windows6.1-KB3192403-86.cab /quiet /norestart
these 2 commands will not run, like i said the psexec runs and then changes directory to the windows/temp but nothing happens after that. Any help would be greatly appreciated. thanks all
----------------------------------------------------------------------------------------
@echo off
for /F "tokens=*" %%1 in (pclist.txt) do (
echo Copying files to %%1
MD "\\%%1\c$\targetfolder"
copy "c:\Users\Kris\Programs\Windows6.1-KB3192403-x86.msu"
"\\%%1\c$\windows\temp"
)
:::: End Copy ::::::
for /F %%a in (pclist.txt) do psexec \\%%a\ cmd /k cd c:\windows\temp &
type "expand -f: *"Windows6.1-KB3192403-x86.msu" %TEMP% &
do dism /online /add-package
/packagepath:c:\windows\temp\Windows6.1-KB3192403-86.cab /quiet /norestart
& pause
-----------------------------------------------------------------------------------------