Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: batch file logging windows 7 home how to question  (Read 15548 times)

0 Members and 1 Guest are viewing this topic.

snowcatman

    Topic Starter


    Beginner

    • Experience: Beginner
    • OS: Windows 8
    Re: batch file logging windows 7 home how to question
    « Reply #15 on: March 09, 2014, 08:00:46 PM »
    I have changed a view things.

    still i am thinking, can i join or have  1>>  2>>  together to log some lines?

    this is what i have so far. i am still fine tuning. your still ahead of me.
    got to think about were to put the ">nul" now will keep reading over what you post.

    Thank You both, foxidrive and Salmon Trout

    this is where i am at so far...
    error.log file
    =============================================================================
    started personal branding script year2014,day09,month03,time18,33.
    -----------------------------------------------------------------
    started selection 2 change logon wallpaper 2014,09,03,18 : 33.
    uac disable
    KILLING PROCESSES NEEDED FOR Modifying imageres.dll
    ERROR: The process "taskmgr.exe" not found.
    ERROR: The process "rundll32.exe" not found.
    ERROR: The process "procexp64.exe" not found.
    taking ownership of imagers file
    'TAKEOWN' is not recognized as an internal or external command,
    operable program or batch file.
    'ICACLS' is not recognized as an internal or external command,
    operable program or batch file.
    make a backup of imageres file
    copy imagers to local folder
    delete system imageres.dll file
    convert imageres dll file
    copy back modified emageres.dll file
    set back ownership of file
    starting processes killed
    The system cannot find the file procexp64.exe.
    enable UAC
    cleanup time
    The system cannot find the file specified.
    The system cannot find the file specified.
    selection 2 change logon wallpaper ended year2014,day09,month03,time18,35.
    ------------------------------------------------------------------

    ==================================================================
    @rem logonwallpaper.bat
    @ECHO OFF
    if not exist "%~dp0\temp" mkdir "%~dp0\temp"
    @rem i will, or may move this to reflect on the choices of the users. may raneme this file
    1>>"%~dp0\temp\error.log" echo =============================================================================
    1>>"%~dp0\temp\error.log" echo started personal branding script year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.

    CLS
    ECHO For windows 7 home
    ECHO Warning: Can not just be administrator.
    ECHO You need to exit and start this
    ECHO file with owner administrator privileges.
    ecHO The one you unhide and secured right?
    ECHO You also need to start the patch file with
    ECHO administrator privilages.
    ECHO If you already have just countinue.
    ECHO Thank You
    echo.
    ECHO Press ctrl and c to quit
    ECHO AND THEN "Y" or
    echo Press Anykey to continue
    ECHO if you did. thank you.
    PAUSE > NUL

    :MENU
    CLS

    ECHO ============= MENU NAME =============
    ECHO -------------------------------------
    ECHO 1.  READ ME FIRST
    ECHO -------------------------------------
    ECHO 2.  Set Logon Wallpaper
    ECHO -------------------------------------
    ECHO 3.  Selection 3
    ECHO -------------------------------------
    ECHO 4.  Selection 4
    ECHO -------------------------------------
    ECHO 5.  Selection 5
    ECHO -------------------------------------
    ECHO 6.  Selection 6
    ECHO -------------------------------------
    ECHO 7.  Selection 7
    ECHO -------------------------------------
    ECHO 8.  Selection 8
    ECHO -------------------------------------
    ECHO 9.  Selection 9
    ECHO -------------------------------------
    ECHO ==========PRESS 'Q' TO QUIT==========
    ECHO.

    SET INPUT=
    SET /P INPUT=Please select a number:

    IF /I "%INPUT%"=="1" GOTO Selection1
    IF /I "%INPUT%"=="2" GOTO Selection2
    IF /I "%INPUT%"=="3" GOTO Selection3
    IF /I "%INPUT%"=="4" GOTO Selection4
    IF /I "%INPUT%"=="5" GOTO Selection5
    IF /I "%INPUT%"=="6" GOTO Selection6
    IF /I "%INPUT%"=="7" GOTO Selection7
    IF /I "%INPUT%"=="8" GOTO Selection8
    IF /I "%INPUT%"=="9" GOTO Selection9
    IF /I "%INPUT%"=="0" GOTO Selection9

    IF /I "%INPUT%"=="q" GOTO Quit

    CLS

    ECHO ============INVALID INPUT============
    ECHO -------------------------------------
    ECHO Please select a number from the Main
    echo Menu [1-9] or select 'q' to quit.
    ECHO -------------------------------------
    ECHO ======PRESS ANY KEY TO CONTINUE======

    PAUSE > NUL
    GOTO MENU

    :Selection1
    1>>"%~dp0\temp\error.log" echo---------------------------------------------------------------
    1>>"%~dp0\temp\error.log" echo started selection 1 reading the read me year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.

    cls
    echo Ok this is to change your wallpaper on your login screen as if you were to do it manually.
    echo Even though we are doing it in a patch file.
    echo I am in the beginning stages of making this work. The reason I made the script the way I
    echo did is to see and know what I am doing with it. I need to see the errors and know if there needs to be a change.
    echo.
    echo the script is full of pauses and you need to tap on the enter key once or twice to see the script move on
    echo.
    echo if you see a drive letter the just type "exit" and the script will continue.
    echo.
    echo it may ask if you are making a folder or a file i choose "file"
    echo.
    echo it needs some touch up so don't nock it for what it is. think if you had
    echo to do it mannually in a batch file how would you do it.
    echo.
    echo also if you make any changes to these files please zip the folder back up and send it my way. thank you
    echo [email protected]
    echo.
    echo thank you.
    echo Press Any Key when done Reading!
    echo.
    PAUSE > NUL
    Goto Menu

    :Selection2

    cls
    1>>"%~dp0\temp\error.log" echo -----------------------------------------------------------------
    1>>"%~dp0\temp\error.log" echo started selection 2 change logon wallpaper %date:~-4,4%,%date:~-7,2%,%date:~-10,2%,%time:~-11,2% : %time:~-8,2%.
    echo processing
    echo.
    echo set UAC to disable
    1>>"%~dp0\temp\error.log" echo uac disable
    2>>"%~dp0\temp\error.log" "%windir%\System32\reg.exe" ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f
    ECHO.
    echo press anykey
    PAUSE > NUL
    @rem 2>>"%~dp0\temp\error.log" sleep.exe 9

    cls
    ECHO KILLING PROCESSES NEEDED FOR Modifying imageres.dll
    1>>"%~dp0\temp\error.log" echo KILLING PROCESSES NEEDED FOR Modifying imageres.dll
    @REM need to make this an if statement if process is running kill it other wise next
    @rem for everyone else if you know how to kill processes useing a dll file i would like to know how. thank you.
    2>>"%~dp0\temp\error.log" %windir%\system32\taskkill /f /IM "taskmgr.exe"
    2>>"%~dp0\temp\error.log" %windir%\system32\taskkill /f /IM "explorer.exe"
    2>>"%~dp0\temp\error.log" %windir%\system32\taskkill /f /IM "rundll32.exe"
    2>>"%~dp0\temp\error.log" %windir%\system32\taskkill /f /IM "procexp64.exe"
    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    echo Take Ownership of imageres.dll
    1>>"%~dp0\temp\error.log" echo taking ownership of imagers file
    2>>"%~dp0\temp\error.log" TAKEOWN /F "%windir%\system32\imageres.dll"
    2>>"%~dp0\temp\error.log" ICACLS "%windir%\system32\imageres.dll" /GRANT Administrators:F

    @rem don't know were i got this or if it is needed but it is here for now.
    @rem think when cleaning up script i will test its need.
    2>>"%~dp0\temp\error.log" SET __COMPAT_LAYER=WINXPSP3

    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    echo Make back up of imageres.dll
    1>>"%~dp0\temp\error.log" echo make a backup of imageres file
    2>>"%~dp0\temp\error.log" copy "%windir%\system32\imageres.dll" "%windir%\system32\imageres.dll_%date:~-4,4%%date:~-7,2%%date:~-10,2%%time:~-11,2%%time:~-8,2%.old" /f /r /w | echo make backup copy attempted
    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    echo Copy imagerers file to folder
    1>>"%~dp0\temp\error.log" echo copy imagers to local folder
    2>>"%~dp0\temp\error.log" copy "%windir%\system32\imageres.dll" "%~dp0\"
    echo attempted copy imageres file to this folder
    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    Echo Delete imagers file in system folder
    1>>"%~dp0\temp\error.log" echo delete system imageres.dll file
    2>>"%~dp0\temp\error.log" %windir%\system32\attrib -r -s -h "%windir%\system32\imageres.dll"
    echo attrib changed attempted
    2>>"%~dp0\temp\error.log" del /q /f "%windir%\system32\imageres.dll"
    echo imageres.ddl delete attempted in the system folder
    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    echo Overwrite image to file
    echo.
    echo this may take some time pending on you computor processing power

    1>>"%~dp0\temp\error.log" echo convert imageres dll file

    set path=%~dp0\

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5031,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo .

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5032,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ..

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5033,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ...

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5034,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ....

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5035,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo .....

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5036,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ......

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5037,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo .......

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5038,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ........

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5039,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ........."25%"

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5040,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ..........

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5041,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ...........

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5042,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ............

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5043,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo .............

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5044,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ..............

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5045,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ..............."50%"

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5046,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ................

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5047,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo .................

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5048,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ..................

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5049,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ...................

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5050,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ...................."75%"

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5051,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo .....................

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5052,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ......................

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5053,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo .......................

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5054,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo ........................

    2>>"%~dp0\temp\error.log" ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5055,
    2>>"%~dp0\temp\error.log" copy "imageres1.dll" "imageres.dll" /y
    echo........................

    %~dp0\ResHacker.exe -addoverwrite %~dp0\imageres.dll, %~dp0\imageres1.dll, %~dp0\cat.jpg, image, 5056,
    echo ........................."100%"

    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    echo Copy modified imageres file back to systems folder
    1>>"%~dp0\temp\error.log" echo copy back modified emageres.dll file
    2>>"%~dp0\temp\error.log" copy "imageres.dll" "%windir%\system32\imageres.dll" /y
    echo copy attempt of imageres file back to system folder
    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    echo Set Back Ownership of imageres.dll
    1>>"%~dp0\temp\error.log" echo set back ownership of file
    @rem got to learn some day soon.
    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    ECHO STARTING PROCESSES NEEDED FOR Modifying imageres.dll
    @REM need to make this an if statement if process is not running start it other wise next. note it shouls start if was stopped really.
    1>>"%~dp0\temp\error.log" echo starting processes killed
    2>>"%~dp0\temp\error.log" start /b explorer.exe
    2>>"%~dp0\temp\error.log" start /b rundll32.exe
    2>>"%~dp0\temp\error.log" start /b procexp64.exe
    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    echo.
    echo set UAC to enable
    1>>"%~dp0\temp\error.log" echo enable UAC
    2>>"%~dp0\temp\error.log" %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

    cls
    echo.
    echo cleanup time
    1>>"%~dp0\temp\error.log" echo cleanup time
    2>>"%~dp0\temp\error.log" move "imagers.dll" "%~dp0\temp"
    2>>"%~dp0\temp\error.log" move "imagers1.dll" "%~dp0\temp"
    ECHO.
    echo press anykey
    PAUSE > NUL

    cls
    ECHO.
    echo Processing Ended
    1>>"%~dp0\temp\error.log" echo selection 2 change logon wallpaper ended year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.
    1>>"%~dp0\temp\error.log" echo ------------------------------------------------------------------
    ECHO.
    echo press anykey

    PAUSE > NUL
    GOTO MENU

    :Selection3

    cls
    @rem idea to go here; is user icon on start menu or login icon setting
    echo wait test
    CALL :sleep 1
    echo 3
    echo press anykey
    PAUSE > NUL
    GOTO MENU

    :Selection4

    cls
    echo 4
    echo press anykey
    PAUSE > NUL
    GOTO MENU

    :Selection5

    cls
    echo 5
    echo press anykey
    PAUSE > NUL
    GOTO MENU

    :Selection6

    cls
    echo 6
    echo press anykey
    PAUSE > NUL
    GOTO MENU

    :Selection7

    cls
    echo 7
    echo press anykey
    PAUSE > NUL
    GOTO MENU

    :Selection8

    cls
    echo 8
    echo press anykey
    PAUSE > NUL
    GOTO MENU

    :Selection9

    cls
    echo 9
    echo press anykey
    PAUSE > NUL
    GOTO MENU

    :Quit
    CLS

    ECHO ==============THANKYOU===============
    ECHO -------------------------------------
    ECHO ======PRESS ANY KEY TO CONTINUE======

    move "%~dp0\temp\error.log" "%~dp0\temp"

    PAUSE>NUL
    EXIT

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: batch file logging windows 7 home how to question
    « Reply #16 on: March 09, 2014, 08:08:52 PM »
    This is causing a lot of your error messages. 

    Code: [Select]
    set path=%~dp0\
    I didn't check why you were using path as a variable name but if you want to add a directory to the path statement then use this:

    Code: [Select]
    set path=%path%;%~dp0
    Otherwise, never use path as a normal variable name.


    Quote
    can i join or have  1>>  2>>  together to log some lines?

    You can add this to redirect all output to a file.  It redirects the STDOUT stream where normal text goes and then redirects the STDERR stream to the same place that STDOUT is going.

    You can add this to the start or the end of a line.  If placed at the end then ensure a space is before the first >>

    Code: [Select]
    >>"%~dp0\temp\error.log" 2>&1


    1=STDOUT (standard out)
    2=STDERR (standard error)

    snowcatman

      Topic Starter


      Beginner

      • Experience: Beginner
      • OS: Windows 8
      Re: batch file logging windows 7 home how to question
      « Reply #17 on: March 09, 2014, 08:58:50 PM »
      just to be clear this would work?

      >>"%~dp0\temp\error.log" 2>&1 command "file"
      2>&1 >>"%~dp0\temp\error.log" command "file"

      because its opening notepad and showing the previous errors.
      « Last Edit: March 09, 2014, 09:14:29 PM by snowcatman »

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: batch file logging windows 7 home how to question
      « Reply #18 on: March 09, 2014, 10:04:33 PM »
      Both these will work - but include a line at the top to delete the log file before it uses it again:  del "%~dp0\temp\error.log" 2>nul

      Code: [Select]
      >>"%~dp0\temp\error.log" 2>&1 command "file"

      command "file" >>"%~dp0\temp\error.log" 2>&1

      snowcatman

        Topic Starter


        Beginner

        • Experience: Beginner
        • OS: Windows 8
        Re: batch file logging windows 7 home how to question
        « Reply #19 on: March 09, 2014, 10:31:05 PM »
        um, i found a major mistake of mine i had doubled my effort to have the log path down. it was opening up the notepad and i was ready to say it not working. but now i am dealing with the cmd window opening up briefly. will go at this tomorrow

        these are the first two log me commands i used this way
        >>"%~dp0\temp\error.log" 2>&1  if not exist "%~dp0\temp" mkdir "%~dp0\temp" >nul

        >>"%~dp0\temp\error.log" 2>&1 "%windir%\System32\reg.exe" ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f >nul






        foxidrive



          Specialist
        • Thanked: 268
        • Experience: Experienced
        • OS: Windows 8
        Re: batch file logging windows 7 home how to question
        « Reply #20 on: March 10, 2014, 12:07:35 AM »
        The first one doesn't need logging - try the second one in a command line by itself to see if it works.

        I did see that you seem to be trying to disable UAC and that hasn't been possible by command line to date. 
        There is no way to programmatically disable UAC at this point in time.

        Code: [Select]
        if not exist "%~dp0\temp" mkdir "%~dp0\temp"

        >>"%~dp0\temp\error.log" 2>&1 "%windir%\System32\reg.exe" ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f

        snowcatman

          Topic Starter


          Beginner

          • Experience: Beginner
          • OS: Windows 8
          Re: batch file logging windows 7 home how to question
          « Reply #21 on: March 10, 2014, 07:49:22 AM »
          good morning. um, when it comes to the UAC i just want it to stop messing with the imageres.dll file long enough for me to to modify it and replace it. i found it helpful. to simple to change it's registry.
          if i wanted i could have the user reboot several times to make the change have more of an impact. but did not see a reason way i should.

          this script is already looking better. thank's to all your help, "foxidrive" and "Salmon Trout"

          I am still seeing errors in console and not in the errors log. a good example would be the "killing of processes".

          information you did not have is i am using a virtual box to test this in.


          -------------------------begining of batch script-------------------------
          ==========================================================================
          started personal branding script year2014,day10,month03,time 6,38.
          -----------------------------------------------------------------
          started selection 2 change logon wallpaper 2014,10,03, 6 : 38.
          uac temp disable
          KILLING PROCESSES NEEDED FOR Modifying imageres.dll
          taking ownership of imagers file
          make a backup of imageres file
          copy imagers to local folder
          delete system imageres.dll file
          convert imageres dll file
          copy back modified emageres.dll file
          set back ownership of file
          starting processes killed
          enable UAC
          cleanup time
          selection 2 change logon wallpaper ended year2014,day10,month03,time 6,41.
          ------------------------------------------------------------------
          =======================================================================
          --------------------------end of batch script--------------------------

          @rem logonwallpaper.bat
          @ECHO OFF
          if not exist "%~dp0\temp" mkdir "%~dp0\temp" >nul
          @rem i will, or may move this to reflect on the choices of the users. may raname this file
          1>>"%~dp0\temp\error.log" echo -------------------------begining of batch script-------------------------
          1>>"%~dp0\temp\error.log" echo ==========================================================================
          1>>"%~dp0\temp\error.log" echo started personal branding script year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.

          CLS
          ECHO For windows 7 home
          ECHO Warning: Can not just be administrator.
          ECHO You need to exit and start this
          ECHO file with owner administrator privileges.
          ecHO The one you unhide and secured right?
          ECHO You also need to start the patch file with
          ECHO administrator privilages.
          ECHO If you already have just countinue.
          ECHO Thank You
          echo.
          ECHO Press ctrl and c to quit
          ECHO AND THEN "Y" or
          echo Press Anykey to continue
          ECHO if you did. thank you.
          PAUSE > NUL

          :MENU
          CLS

          ECHO ============= MENU NAME =============
          ECHO -------------------------------------
          ECHO 1.  READ ME FIRST
          ECHO -------------------------------------
          ECHO 2.  Set Logon Wallpaper
          ECHO -------------------------------------
          ECHO 3.  Selection 3
          ECHO -------------------------------------
          ECHO 4.  Selection 4
          ECHO -------------------------------------
          ECHO 5.  Selection 5
          ECHO -------------------------------------
          ECHO 6.  Selection 6
          ECHO -------------------------------------
          ECHO 7.  Selection 7
          ECHO -------------------------------------
          ECHO 8.  Selection 8
          ECHO -------------------------------------
          ECHO 9.  Selection 9
          ECHO -------------------------------------
          ECHO ==========PRESS 'Q' TO QUIT==========
          ECHO.

          SET INPUT=
          SET /P INPUT=Please select a number:

          IF /I "%INPUT%"=="1" GOTO Selection1
          IF /I "%INPUT%"=="2" GOTO Selection2
          IF /I "%INPUT%"=="3" GOTO Selection3
          IF /I "%INPUT%"=="4" GOTO Selection4
          IF /I "%INPUT%"=="5" GOTO Selection5
          IF /I "%INPUT%"=="6" GOTO Selection6
          IF /I "%INPUT%"=="7" GOTO Selection7
          IF /I "%INPUT%"=="8" GOTO Selection8
          IF /I "%INPUT%"=="9" GOTO Selection9
          IF /I "%INPUT%"=="0" GOTO Selection9

          IF /I "%INPUT%"=="q" GOTO Quit

          CLS

          ECHO ============INVALID INPUT============
          ECHO -------------------------------------
          ECHO Please select a number from the Main
          echo Menu [1-9] or select 'q' to quit.
          ECHO -------------------------------------
          ECHO ======PRESS ANY KEY TO CONTINUE======

          PAUSE > NUL
          GOTO MENU

          :Selection1
          1>>"%~dp0\temp\error.log" echo---------------------------------------------------------------
          1>>"%~dp0\temp\error.log" echo started selection 1 reading the read me year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.

          cls

          echo -------------reboot your computer in between uses for smoother operation-----------------------
          echo.
          echo Ok this is to change your wallpaper on your login screen as if you were to do it manually in dos.
          echo Even though we are doing it in a patch file.
          echo I am in the beginning stages of making this work. The reason I made the script the way I
          echo did is to see and know what I am doing with it. I need to see the errors and know if there needs to be a change.
          echo.
          echo the script is full of pauses and you need to tap on the enter key once or twice to see the script move on
          echo.
          echo if you see a drive letter then just type "exit" and the script will continue or not. you need to be
          echo familier with task manager and able to start at least explorer.exe
          echo.
          echo it may ask if you are making a folder or a file. I choose "file". we are not making more then a temp folder
          echo from the begining of this batch file
          echo.
          echo it needs some touch up so don't nock it for what it is. think if you had
          echo to do it mannually in a batch file might make a few mistakes when you do it.
          echo.
          echo also if you make any changes to these files please zip the folder back up and send it my way. thank you
          echo [email protected] i hould be interested in your changes. please leave notes.
          echo.
          echo thank you.
          echo Press Any Key when done Reading!
          echo.
          PAUSE > NUL
          Goto Menu

          :Selection2

          cls
          1>>"%~dp0\temp\error.log" echo -----------------------------------------------------------------
          1>>"%~dp0\temp\error.log" echo started selection 2 change logon wallpaper %date:~-4,4%,%date:~-7,2%,%date:~-10,2%,%time:~-11,2% : %time:~-8,2%.
          echo processing
          echo.
          echo set UAC to disable
          @rem note: foxidrive noted; I did see that you seem to be trying to disable UAC and that hasn't been
          @rem possible by command line to date. There is no way to programmatically disable UAC at this point in time.
          @rem selfnote. i only want some of the processes to leave imageres.dll alone. not to fully disable UAC
          @rem future note, may need to fully disable UAC. need to think on how to go about returning to script after reboot for that.

          1>>"%~dp0\temp\error.log" echo uac temp disable
          >>"%~dp0\temp\error.log" 2>&1 "%windir%\System32\reg.exe" ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f >nul
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          ECHO KILLING PROCESSES NEEDED FOR Modifying imageres.dll
          1>>"%~dp0\temp\error.log" echo KILLING PROCESSES NEEDED FOR Modifying imageres.dll
          @REM need to make this an if statement if process is running kill it other wise next
          @rem for everyone else if you know how to kill processes depening on a curent dll file i would like to know how. thank you.
          >>"%~dp0\temp\error.log" 2>&1  %windir%\system32\taskkill /f /IM "taskmgr.exe" >nul
          >>"%~dp0\temp\error.log" 2>&1  %windir%\system32\taskkill /f /IM "explorer.exe" >nul
          >>"%~dp0\temp\error.log" 2>&1  %windir%\system32\taskkill /f /IM "rundll32.exe" >nul
          >>"%~dp0\temp\error.log" 2>&1  %windir%\system32\taskkill /f /IM "procexp64.exe" >nul
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          echo Take Ownership of imageres.dll
          1>>"%~dp0\temp\error.log" echo taking ownership of imagers file
          >>"%~dp0\temp\error.log" 2>&1  %windir%\system32\TAKEOWN /F "%windir%\system32\imageres.dll" >nul
          >>"%~dp0\temp\error.log" 2>&1  %windir%\system32\ICACLS "%windir%\system32\imageres.dll" /GRANT Administrators:F >nul

          @rem don't know were i got this or if it is needed but it is here for now.
          @rem think when cleaning up script i will test its need.
          >>"%~dp0\temp\error.log" 2>&1 SET __COMPAT_LAYER=WINXPSP3 >nul

          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          echo Make back up of imageres.dll
          1>>"%~dp0\temp\error.log" echo make a backup of imageres file
          >>"%~dp0\temp\error.log" 2>&1  copy "%windir%\system32\imageres.dll" "%windir%\system32\imageres.dll_%date:~-4,4%%date:~-7,2%%date:~-10,2%%time:~-11,2%%time:~-8,2%.old" /f /r /w >nul
          echo make backup copy attempted
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          echo Copy imagerers file to folder
          1>>"%~dp0\temp\error.log" echo copy imagers to local folder
          >>"%~dp0\temp\error.log" 2>&1  copy "%windir%\system32\imageres.dll" "%~dp0\" >nul
          echo attempted copy imageres file to this folder
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          Echo Delete imagers file in system folder
          1>>"%~dp0\temp\error.log" echo delete system imageres.dll file
          >>"%~dp0\temp\error.log" 2>&1  %windir%\system32\attrib -r -s -h "%windir%\system32\imageres.dll" >nul
          echo attrib changed attempted
          >>"%~dp0\temp\error.log" 2>&1  del /q /f "%windir%\system32\imageres.dll" >nul
          echo imageres.ddl delete attempted in the system folder
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          echo Overwrite image to file
          echo.
          echo this may take some time pending on you computor processing power

          1>>"%~dp0\temp\error.log" echo convert imageres dll file

          set path=%path%;%~dp0

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5031,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo .

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5032,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ..

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5033,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ...

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5034,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ....

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5035,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo .....

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5036,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ......

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5037,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo .......

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5038,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ........

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5039,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ........."25%"

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5040,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ..........

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5041,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ...........

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5042,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ............

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5043,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo .............

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5044,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ..............

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5045,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ..............."50%"

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5046,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5047,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo .................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5048,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ..................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5049,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ...................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5050,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ...................."75%"

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5051,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo .....................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5052,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ......................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5053,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo .......................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5054,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo ........................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5055,
          >>"%~dp0\temp\error.log" 2>&1  copy "imageres1.dll" "imageres.dll" /y >nul
          echo........................

          >>"%~dp0\temp\error.log" 2>&1  ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "cat.jpg", image, 5056,
          echo ........................."100%"

          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          echo Copy modified imageres file back to systems folder
          1>>"%~dp0\temp\error.log" echo copy back modified emageres.dll file
          >>"%~dp0\temp\error.log" 2>&1" %~dp0\temp\error.log" copy "imageres.dll" "%windir%\system32\imageres.dll" /y >nul
          echo copy attempt of imageres file back to system folder
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          echo Set Back Ownership of imageres.dll
          1>>"%~dp0\temp\error.log" echo set back ownership of file
          @rem got to learn some day soon.
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          ECHO STARTING PROCESSES depending on imageres.dll
          @REM need to make this an if statement if process was killed then restart it.
          1>>"%~dp0\temp\error.log" echo starting processes killed
          >>"%~dp0\temp\error.log" 2>&1  start /b explorer.exe >nul
          >>"%~dp0\temp\error.log" 2>&1  start /b rundll32.exe >nul
          >>"%~dp0\temp\error.log" 2>&1  start /b procexp64.exe >nul
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          echo.
          echo set UAC to enable
          1>>"%~dp0\temp\error.log" echo enable UAC
          >>"%~dp0\temp\error.log" 2>&1  %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f >nul

          cls
          echo.
          echo cleanup time
          1>>"%~dp0\temp\error.log" echo cleanup time
          >>"%~dp0\temp\error.log" 2>&1  move "imagers.dll" "%~dp0\temp" >nul
          >>"%~dp0\temp\error.log" 2>&1  move "imagers1.dll" "%~dp0\temp" >nul
          ECHO.
          echo press anykey
          PAUSE > NUL

          cls
          ECHO.
          echo Processing Ended
          1>>"%~dp0\temp\error.log" echo selection 2 change logon wallpaper ended year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.
          1>>"%~dp0\temp\error.log" echo ------------------------------------------------------------------
          ECHO.
          echo press anykey

          PAUSE > NUL
          GOTO MENU

          :Selection3

          cls
          @rem idea to go here; is user icon on start menu or login icon setting
          echo wait test
          CALL :sleep 1
          echo 3
          echo press anykey
          PAUSE > NUL
          GOTO MENU

          :Selection4

          cls
          echo 4
          echo press anykey
          PAUSE > NUL
          GOTO MENU

          :Selection5

          cls
          echo 5
          echo press anykey
          PAUSE > NUL
          GOTO MENU

          :Selection6

          cls
          echo 6
          echo press anykey
          PAUSE > NUL
          GOTO MENU

          :Selection7

          cls
          echo 7
          echo press anykey
          PAUSE > NUL
          GOTO MENU

          :Selection8

          cls
          echo 8
          echo press anykey
          PAUSE > NUL
          GOTO MENU

          :Selection9

          cls
          echo 9
          echo press anykey
          PAUSE > NUL
          GOTO MENU

          :Quit
          CLS

          ECHO ==============THANKYOU===============
          ECHO -------------------------------------
          ECHO ======PRESS ANY KEY TO CONTINUE======

          1>>"%~dp0\temp\error.log" echo =======================================================================
          1>>"%~dp0\temp\error.log" echo --------------------------end of batch script--------------------------

          move "%~dp0\temp\error.log" "%~dp0\temp" >nul

          PAUSE>NUL
          EXIT

          snowcatman

            Topic Starter


            Beginner

            • Experience: Beginner
            • OS: Windows 8
            Re: batch file logging windows 7 home how to question
            « Reply #22 on: March 10, 2014, 01:51:01 PM »
            dont know if its logging right or if i need to start another thread but here it goes.
            getting some strange errors too
            source commands: from logonwallpaper.bat

            cls
            Echo Delete imagers file in system folder
            1>>"%~dp0\temp\error.log" echo delete system imageres.dll file attempted
            >>"%~dp0\temp\error.log" 2>&1  %windir%\system32\attrib -r -s -h "%windir%\system32\imageres.dll" >nul
            echo attrib changed attempted
            >>"%~dp0\temp\error.log" 2>&1  del /f /a h s  "%windir%\system32\imageres.dll"
            echo imageres.ddl delete attempted in the system folder
            ECHO.
            echo press anykey
            PAUSE > NUL

            error.log

            ----------------------------------------------------------------------------------
              -------------------------begining of batch script-------------------------
            ==========================================================================
            started personal branding script year2014,day10,month03,time12,36.
            -----------------------------------------------------------------
            started selection 2 change logon wallpaper 2014,10,03,12 : 36.
            uac temp disable
            KILLING PROCESSES NEEDED FOR Modifying imageres.dll
            taking ownership of imagers file
            make a backup of imageres file
            copy imagers to local folder
            delete system imageres.dll file attempted
            Could Not Find F:\PortableApps\Notepad++Portable\App\Notepad++\h
            Could Not Find C:\Windows\system32\imageres.dll

            convert imageres dll file
            copy back modified emageres.dll file
            set back ownership of file
            starting processes killed
            enable UAC
            cleanup time
            selection 2 change logon wallpaper ended year2014,day10,month03,time12,36.
            ------------------------------------------------------------------
            =======================================================================
            --------------------------end of batch script--------------------------


            i checked and the file imageres.dll was in the %windir%\system32\ so there must be an error?

            did the batch outside notepad++ and got this...

            -------------------------begining of batch script-------------------------
            ==========================================================================
            started personal branding script year2014,day10,month03,time12,58.
            -----------------------------------------------------------------
            started selection 2 change logon wallpaper 2014,10,03,12 : 59.
            uac temp disable
            KILLING PROCESSES NEEDED FOR Modifying imageres.dll
            taking ownership of imagers file
            make a backup of imageres file
            copy imagers to local folder
            delete system imageres.dll file attempted
            Could Not Find E:\BATCH.START\h
            convert imageres dll file
            copy back modified emageres.dll file
            set back ownership of file
            starting processes killed
            enable UAC
            cleanup time
            selection 2 change logon wallpaper ended year2014,day10,month03,time13,04.
            ------------------------------------------------------------------
            =======================================================================
            --------------------------end of batch script--------------------------
            « Last Edit: March 10, 2014, 02:21:04 PM by snowcatman »

            foxidrive



              Specialist
            • Thanked: 268
            • Experience: Experienced
            • OS: Windows 8
            Re: batch file logging windows 7 home how to question
            « Reply #23 on: March 10, 2014, 05:50:25 PM »
            I added the two pause commands and when they appear check "%windir%\system32\imageres.dll" to see what attributes it has, and if it is being deleted.


            Code: [Select]
            cls
            Echo Delete imagers file in system folder
            1>>"%~dp0\temp\error.log" echo delete system imageres.dll file
            2>>"%~dp0\temp\error.log" %windir%\system32\attrib -r -s -h "%windir%\system32\imageres.dll"
            pause
            echo attrib changed attempted
            2>>"%~dp0\temp\error.log" del /q /f "%windir%\system32\imageres.dll"
            pause
            echo imageres.ddl delete attempted in the system folder
            ECHO.

            snowcatman

              Topic Starter


              Beginner

              • Experience: Beginner
              • OS: Windows 8
              Re: batch file logging windows 7 home how to question
              « Reply #24 on: March 10, 2014, 09:52:40 PM »
              ok there were no errors but something is still amiss because i see the rest of the script going really fast. like  its missing the imageres file.
              plus i see error in the console instead of the error log. i don't mind seeing them in the console but would like to see them in the error log too.

              -------------------------begining of batch script-------------------------
              ==========================================================================
              started personal branding script year2014,day10,month03,time20,37.
              -----------------------------------------------------------------
              started selection 2 change logon wallpaper 2014,10,03,20 : 37.
              uac temp disable
              KILLING PROCESSES NEEDED FOR Modifying imageres.dll
              taking ownership of imagers file
              make a backup of imageres file
              copy imagers to local folder
              delete system imageres.dll file
              convert imageres dll file
              copy back modified emageres.dll file
              set back ownership of file
              starting processes killed
              enable UAC
              cleanup time
              selection 2 change logon wallpaper ended year2014,day10,month03,time20,37.
              ------------------------------------------------------------------
              =======================================================================
              --------------------------end of batch script--------------------------


              i guess its just looking better. it's getting harder to tell whats going on in there too.

              i have been wrecking my brain on how to deal with this one file. it plague me. its like windows makes use of this file in a multitude of ways. imageres.dll has icons and a sound file as well as wallpaper it . i seen some programming too. i think what i am going to have to do is start windows in dos mode and run the batch file. maybe it will work then. don't know

              foxidrive



                Specialist
              • Thanked: 268
              • Experience: Experienced
              • OS: Windows 8
              Re: batch file logging windows 7 home how to question
              « Reply #25 on: March 10, 2014, 10:20:07 PM »
              There's a command line tool here to change wallpaper.

              http://sg20.com/techblog/2011/06/23/wallpaper-changer-command-line-utility/

              snowcatman

                Topic Starter


                Beginner

                • Experience: Beginner
                • OS: Windows 8
                Re: batch file logging windows 7 home how to question
                « Reply #26 on: March 11, 2014, 06:54:59 AM »
                Good morning.
                Thank you for that link foxidrive

                not chewing you out. this just fyi. thank you.
                din't know if you noticed. but this is not the wallpaper on you work space that i am changing. it's the wallpaper on your "logon screen" that i am changing. windows does not provide a user friendly way to change this. If at all. I know there is programming out there already that does this. I am just am trying to learn how to do it. so to learn and leave steps or notes on how to do it. For the fun of it.

                for the most part it works. i just keep finding the errors in a batch script and want to clean it up.
                the problem is a user is going to use this multiple times. and windows seems to use that file "imageres.dll" in multitude of way's.
                hence my problem. the "imageres.dll" gets locked up easily. from permissions to uac to attributes, file in use, etc

                keeping on topic.
                --------------------------------------------------------

                1>>"%~dp0\temp\error.log" command file >nul  ---> works well
                2>>"%~dp0\temp\error.log" command file >nul  ---> works well
                >>"%~dp0\temp\error.log" 2>&1 command file >nul  ---> works well

                the problem notice here is "cls" gets modified and the screen just allowed to scroll up. nice but not very friendly.
                To log an entire batch file you use this at the command line or in a separate batch file:


                Code: [Select]
                logonwallpaper.bat 1>output.txt 2> error.txt
                The 1 is optional.

                But this will also remove any text that you want to see, and if you have an input command in the batch file then it is not the right way to log it.
                You use the technique above when the batch file is not interactive.

                To get around that you can use a tee filter
                Here is one in a separate batch file and you can use it like this: 
                Code: [Select]
                logonwallpaper.bat | batchtee logfile.txt

                Read the limitations in the batch code below, and there are other tee filters for modern Windows like Swiss File Knife on Sourceforge.


                Code: [Select]
                ::batchTee.bat  OutputFile  [+]
                ::
                ::  Write each line of stdin to both stdout and outputFile.
                ::  The default behavior is to overwrite any existing outputFile.
                ::  If the 2nd argument is + then the content is appended to any existing
                ::  outputFile.
                ::
                ::  Limitations:
                ::
                ::  1) Lines are limited to ~1000 bytes. The exact maximum line length varies
                ::     depending on the line number. The SET /P command is limited to reading
                ::     1021 bytes per line, and each line is prefixed with the line number when
                ::     it is read.
                ::
                ::  2) Trailing control characters are stripped from each line.
                ::
                ::  3) Lines will not appear on the console until a newline is issued, or
                ::     when the input is exhaused. This can be a problem if the left side of
                ::     the pipe issues a prompt and then waits for user input on the same line.
                ::     The prompt will not appear until after the input is provided.
                ::

                @echo off
                setlocal enableDelayedExpansion
                if "%~1" equ ":tee" goto :tee

                :lock
                set "teeTemp=%temp%\tee%time::=_%"
                2>nul (
                  9>"%teeTemp%.lock" (
                    for %%F in ("%teeTemp%.test") do (
                      set "yes="
                      pushd "%temp%"
                      copy /y nul "%%~nxF" >nul
                      for /f "tokens=2 delims=(/" %%A in (
                        '^<nul copy /-y nul "%%~nxF"'
                      ) do if not defined yes set "yes=%%A"
                      popd
                    )
                    for /f %%A in ("!yes!") do (
                        find /n /v ""
                         echo :END
                         echo %%A
                      ) >"%teeTemp%.tmp" | <"%teeTemp%.tmp" "%~f0" :tee %* 7>&1 >nul
                    (call )
                  ) || goto :lock
                )
                del "%teeTemp%.lock" "%teeTemp%.tmp" "%teeTemp%.test"
                exit /b

                :tee
                set "redirect=>"
                if "%~3" equ "+" set "redirect=>>"
                8%redirect% %2 (call :tee2)
                set "redirect="
                (echo ERROR: %~nx0 unable to open %2)>&7

                :tee2
                for /l %%. in () do (
                  set "ln="
                  set /p "ln="
                  if defined ln (
                    if "!ln:~0,4!" equ ":END" exit
                    set "ln=!ln:*]=!"
                    (echo(!ln!)>&7
                    if defined redirect (echo(!ln!)>&8
                  )
                )



                logonwallpaper.bat 1>output.txt 2> error.txt

                i am looking at the different ways to log the errors and want to see how to fix my issues.

                you have been a asset and thank you for your help. i don't know all there is to know put am putting the effort into learning what i can. thank you for your patience.

                Hope i put enough info out for review and not to much. again thank you.

                i think in order to slow down this script i need to switch to if then statements and do something about check the file states. just a thought.
                « Last Edit: March 11, 2014, 07:49:46 AM by snowcatman »

                snowcatman

                  Topic Starter


                  Beginner

                  • Experience: Beginner
                  • OS: Windows 8
                  Re: batch file logging windows 7 home how to question
                  « Reply #27 on: March 11, 2014, 09:54:47 AM »
                  thinking about just not deleting the imageres.dll. causes too may issues. instead i will considerate on replacing it.

                  snowcatman

                    Topic Starter


                    Beginner

                    • Experience: Beginner
                    • OS: Windows 8
                    Re: batch file logging windows 7 home how to question
                    « Reply #28 on: March 11, 2014, 05:06:19 PM »
                    ok i seen something that makes cents to me now. kinda went way over my head... ::)

                    1>>"%~dp0\temp\error.log" command file >nul
                    Works well, ya it worked but you are not going to get a much of message in your error.log.

                    1>>"%~dp0\temp\error.log" command file                     <-----note no >null
                    Ok this works too. but now you will see the STDOUT and STDERR messages in your log file.

                    1>>"%~dp0\temp\error.log"            notice no comand file or >nul ???
                    I also noticed if you don't complete you line then you break your cmd the window closes.

                    Squashman



                      Specialist
                    • Thanked: 134
                    • Experience: Experienced
                    • OS: Other
                    Re: batch file logging windows 7 home how to question
                    « Reply #29 on: March 11, 2014, 05:46:44 PM »
                    Seems like it would be a lot easier to do this. You could script this as well but  you would still get UAC prompts.
                    http://www.techrepublic.com/blog/windows-and-office/change-and-customize-windows-7s-logon-screen-wallpaper/