Will look at this tomorrow, there should be implemented the version check and some jumps in case of Starter and Home Basic, although they shouldn´t be very widespread . Only a little challenge to get the write part properly working. Personally i have no problem to close the personalization window, as it normally happens very seldom. Unfortunately i only found some crude VBS scripts which didn´t always work as expected. The messages can be easily integrated, but mostly they will be shown only a fraction of a moment, not shure, if a ping makes sense here. Unfortunately this can´t run fully hidden, as it requires user interaction.
What if Explorer.exe is closed and then reopened? Just have to make sure that it is opened without administrative properties.
1. There may be multiple Explorer.exe open - which one to close? 2. Restarting Explorer.exe causes loss of some tray icons (if it was the primary shell).
Well if we overlooked the tray icons (ppft) then it could be: taskkill /F /FI "IMAGENAME eq explorer.exe" I think your right on the icons. What about signing the user out? Shutdown -L
Version check: Code: for /f "tokens=2,3,4,5,6,7 delims= " %%a in ('wmic os get caption') do set ver=%%a %%b %%c %%d %%e %%f :loopV if "%ver:~-1%"==" " set "ver=%ver:~0,-1%" & goto :loopV Jumps in case Starter or Home Basic is found: Code: :Backup if "%ver%" == "Windows 7 Starter" ( goto :Exit ) if "%ver%" == "Windows 7 Home Basic" ( goto :BackupHB ) if exist "%systemdrive%\IR6\IR6Bkup.theme" del /s /q "%systemdrive%\IR6\IR6Bkup.theme" >nul echo F | xcopy "%themefile%" /s /q "%systemdrive%\IR6\" /Y /V >nul ren "%systemdrive%\IR6\%theme%.theme" "IR6Bkup.theme" goto :Exit :BackupHB xcopy "%wppath%\TranscodedWallpaper.jpg" /s /q "%%systemdrive%%\IR6" /Y >nul goto :Exit :Rearm for /f "usebackq tokens=2 delims==" %%n in (`"%SystemRoot%\System32\wbem\WMIC.exe" /namespace:\\root\cimv2 path SoftwareLicensingService get RemainingWindowsReArmCount /format:list`) do set r=%%n if %r% == 0 goto :Messagebox cscript.exe /b %windir%\system32\slmgr.vbs /rearm net stop sppsvc >NUL net start sppsvc >NUL schtasks /query | FINDSTR /i "IR6" >nul if %errorlevel%==0 ( schtasks /create /tn "IR6" /tr "'%systemdrive%\Windows\system32\cmd.exe' /c cscript.exe /b %SystemDrive%\Windows\System32\slmgr.vbs /rearm && net stop sppsvc && net start sppsvc" /sc daily /mo 30 /ru "" /f >NUL schtasks /create /tn "Hybrid2" /tr "%SystemDrive%\IR6\Check.bat" /sc onlogon /rl highest /f >nul ) if "%ver%" == "Windows 7 Starter" ( goto :RestoreS ) if "%ver%" == "Windows 7 Home Basic" ( goto :RestoreHB ) echo F | xcopy "%systemdrive%\IR6\IR6Bkup.theme" /s /q "%windir%\resources\Themes" /Y /V >nul start rundll32.exe Shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /File:"C:\Windows\Resources\Themes\IR6Bkup.theme" reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes" /t REG_SZ /v CurrentTheme /d "%windir%\resources\Themes\IR6Bkup.theme" /f >NUL goto :Exit :RestoreS reg add "HKCU\\ControlPanel\\Desktop" /f /v "Wallpaper" /d "%windir%\web\wallpaper\windows\img0.jpg" /t "REG_SZ" >nul goto :Exit :RestoreHB xcopy "%systemdrive%\IR6\TranscodedWallpaper.jpg" /s /q "%wppath%" /Y >nul goto :Exit
Home Basic: 1. Inserted Pause into Duality just before initial reboot into WinRE. 2. Installed IR6. 3. Drop-in replaced the check.bat. 4. Did the initial C:IR6 stuff. 5. When returning into Windows, the ''IR6 Check Task'' stays up forever. I see an XCopy process running, but nothing ever happens. Could it be hanging at the question if the destination is a directory/file?
If hanging cause of that then: ECHO F| xcopy "%wppath%\TranscodedWallpaper.jpg" /s /q "%%systemdrive%%\IR6" /Y >nul II think it is.
A ping would only extend the torture of the Check.bat being visible so we'll put what messages make sense to put Yea it would be great to close the personalization window after restore I actually get a message in check.bat console as it closes that says something about a pipe (No jokes please ...lol)
Yes. With the echo F modification by Humphrey it doesn't hang, but doesn't create a backup, either...
As it is copying an existing file, that shouldn´t matter in this case. Maybe the path is different here? Need some sleep now, will set up VMs later .
Gotcha! That line works. For some reason the systemdrive variable had double percent signs (xcopy "%wppath%\TranscodedWallpaper.jpg" /s /q "%%systemdrive%%\IR6" /Y >nul). Code: echo F | xcopy "%wppath%\TranscodedWallpaper.jpg" /s /q "%systemdrive%\IR6\" /Y >nul
My bad ...didn´t check this . BTW: Was from an old version of the write part, i failed to correct all doubled signs.
New problems with Home Basic. Backup works, but restore needs two parts. 1. Copying the TranscodedWallpaper.jpg file back. 2. Set the Wallpaper value in HKCU\ControlPanel\Desktop to %APPDATA%\Microsoft\Windows\Themes\TranscodedWallpaper.jpg (since Windows empies it). Even then, I needed to log out and back in... Next is Starter. Oh joy.
Code: reg add "HKCU\\ControlPanel\\Desktop" /f /v "Wallpaper" /d "%AppData%\Microsoft\Windows\Themes\TranscodedWallpaper.jpg" /t "REG_SZ" >nul This is what I used.
Code: reg add "HKCU\Control Panel\Desktop" /f /v "Wallpaper" /d "%AppData%\Microsoft\Windows\Themes\TranscodedWallpaper.jpg" /t REG_SZ >nul Correction to the reg command. It is "Control Panel" (with a space), and it must be single backslashes.