Newbie Question: installing hotfixes and checking IF exist

  • Thread starter Thread starter Support
  • Start date Start date
S

Support

I am trying to install some hotfixes from a network share and would
like my script to check the existence of a file and if not exist, then
execute the updates and restart. If exist then carry on. If the
updates have already been run, then a log file is created on the local
machine in c:\windows
My script is as follows:

net use n: \\server\Install
set PATHTOFIXES=n:\Hotfix
if exist "c:\windows\Q329170.log""c:\windows\Q812937.log" goto :eof
For /R "n:\hotfixes\%%a" %%a IN (*.log) DO (
if NOT exist "..\folder2\%%a" "%%~dpnA.exe"
%PATHTOFIXES%\Q329170.exe /U /Z
%PATHTOFIXES%\Q812937.exe /U /Z
shutdown -r

Now I'm not particularly sure if I need the For and if NOT exist
parameter as they are here (i saw it on another similar question but don't
understand what it is doing)
and having looked at the command help and
parameters I'm wondering if the following would be sufficient:

net use n: \\server\Install
set PATHTOFIXES=n:\Hotfix
if exist "c:\windows\Q329170.log""c:\windows\Q812937.log" goto :eof
if NOT exist %PATHTOFIXES%\Q329170.exe /U /Z
%PATHTOFIXES%\Q812937.exe /U /Z
shutdown -r

however after testing both of these, neither has worked. Any ideas?
 
:

Please don't multipost, if necessary crosspost. There were small errors
in the replys you got in amb. See ambnt for some more hints.
 
Back
Top