problem with script files
Posted: 13 Jun 2013 09:51
Hi,
I have a self extracting EXE that dumps the below script into %temp% as well as a screensaver. The script does not appear to be able to handle copying the screensaver to %windir%\system32.
@ECHO ON
Set RegVar=HKLM\Hardware\Description\System\CentralProcessor\0
REG.exe Query %RegVar% 2>NUL | find /I /N "x86">NUL
If [%ERRORLEVEL%] == [0] (
echo X86
cd %windir%\system32
If exist brian.scr ren brian.scr brianold01.scr
GOTO FILEMOVE1
) ELSE (
echo AMD64
cd %windir%\system32
If exist brian.scr ren brian.scr brianold01.scr
cd %windir%\sysWOW64
If exist brian.scr ren brian.scr brianold01.scr
GOTO FILEMOVE2
)
:FILEMOVE1
MOVE /Y %~dp0\brian.scr %windir%\system32\brian.scr
exit
:FILEMOVE2
COPY /Y %~dp0\brian.scr %windir%\system32\brian.scr
MOVE /Y %~dp0\brian.scr %windir%\sysWOW64\brian.scr
exit
Any ideas as to what could be broken?
I have a self extracting EXE that dumps the below script into %temp% as well as a screensaver. The script does not appear to be able to handle copying the screensaver to %windir%\system32.
@ECHO ON
Set RegVar=HKLM\Hardware\Description\System\CentralProcessor\0
REG.exe Query %RegVar% 2>NUL | find /I /N "x86">NUL
If [%ERRORLEVEL%] == [0] (
echo X86
cd %windir%\system32
If exist brian.scr ren brian.scr brianold01.scr
GOTO FILEMOVE1
) ELSE (
echo AMD64
cd %windir%\system32
If exist brian.scr ren brian.scr brianold01.scr
cd %windir%\sysWOW64
If exist brian.scr ren brian.scr brianold01.scr
GOTO FILEMOVE2
)
:FILEMOVE1
MOVE /Y %~dp0\brian.scr %windir%\system32\brian.scr
exit
:FILEMOVE2
COPY /Y %~dp0\brian.scr %windir%\system32\brian.scr
MOVE /Y %~dp0\brian.scr %windir%\sysWOW64\brian.scr
exit
Any ideas as to what could be broken?