Client Management Suite

 View Only
  • 1.  batch script problem

    Posted Jun 13, 2013 01:17 PM

    Hi,

    I have a self extracting EXE (I have imported it into Software Catalog) created from WinRAR that dumps the below script into %temp%. It is supposed to also copy or move the screensaver out of the EXE and into its respective directory.


    @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

    I think the part of the script that is broken is related to renaming or copying the file on AMD64 (x64) in c:\windows\system32. When I run this outside of Altiris I right click and choose run as admin.

    Help appreciated.



  • 2.  RE: batch script problem

    Posted Jun 13, 2013 02:11 PM

    Add

    >> brian.log 2>&1

    to the end of each line in the batch file.