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