Was busy maintaining my tool and playing with new DISM and Powershell Features in Win 8.1 Spring Update . Nice exploration of BetonMAN i must commit . If i get it right, this new way needs a reboot after deleting the reg key and during Startup the correct key has to be applied via Task and appropriate cmd, the latter gets deleted afterwards.
Would make things a lot easier if we would skip Backup/Restore of theme, as this is responsible for having those :BackupHB stuff and the others . Nice new smiley btw (Thanks to Yen) .
And Tito Do you mean skip Starter/HB ...lol And here is RWTE Code: @echo off title RWTE >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" set params = %*:"="" echo UAC.ShellExecute "%~s0", "%params%", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" exit /B :gotAdmin if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) pushd "%CD%" CD /D "%~dp0" goto mainmenu :mainmenu mode con: cols=32 lines=8 echo. echo Rearm Wizard Testing Equipment echo. echo. A. Set date ahead 33 days? echo. B. Eliminate all rearms? echo. C. Exit echo. set userinp= set /p userinp= ^ Make your selection: set userinp=%userinp:~0,1% if /i "%userinp%"=="A" goto A if /i "%userinp%"=="B" goto B if /i "%userinp%"=="C" goto exit GOTO :mainmenu :A cls mode con: cols=44 lines=11 setlocal EnableDelayedExpansion for /f "tokens=1,2*" %%a in ('reg query "HKCU\Control Panel\International"^|findstr /i "\<[is]Date\>"') do set "%%a=%%c" call :DaysAdd 33 newDate date %newDate% echo( :loop2 echo New date: %date% echo( cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Status" echo. cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Remaining" echo. echo Would you like to correctly reset the date? echo( echo A. Yes echo. set /p "c=Make your selection: " if /i "!c!" neq "A" cls & goto loop2 call :DaysAdd -33 newDate date %newDate% goto :mainmenu :DaysAdd ByVal_DeltaIn ByRef_NewDateOut setlocal for /f "tokens=1-3 delims=%sDate%" %%a in ("%date:* =%") do ( if %iDate%==0 (set /a Month=100%%a%%100,Day=100%%b%%100,Year=10000%%c%%10000) else ( if %iDate%==1 (set /a Day=100%%a%%100,Month=100%%b%%100,Year=10000%%c%%10000) else ( if %iDate%==2 (set /a Year=10000%%a%%10000,Month=100%%b%%100,Day=100%%c%%100) ))) set /a "a = 14 - Month, a /= 12, b = Year + 4800 - a, c = Month + 12 * a - 3, d = 153 * c + 2" set /a "d = d / 5 + Day + b * 365 + b / 4 - b / 100 + b / 400 - 1 + %~1" set /a "e = 4 * d + 3, e /= 146097, f = -e * 146097, f /= 4, f += d" set /a "g = 4 * f + 3, g /= 1461, h = -1461 * g, h /= 4, h += f, i = 5 * h + 2, i /= 153, Day = 153 * i + 2, Day /= 5" set /a "Day = -Day + h + 1, Month = -i / 10, Month *= 12, Month += i + 3, Year = e * 100 + g - 4800 + i / 10" set /a "Month = 10%Month%, Day = 10%Day%" if %iDate%==0 (set "new=%Month:~-2%%sDate%%Day:~-2%%sDate%%Year%") else ( if %iDate%==1 (set "new=%Day:~-2%%sDate%%Month:~-2%%sDate%%Year%") else ( if %iDate%==2 (set "new=%Year%%sDate%%Month:~-2%%sDate%%Day:~-2%"))) endlocal &set "%~2=%new%" &goto:eof :B cls mode con: cols=35 lines=2 echo Eliminating all rearms... :loop3 cscript.exe /b %SystemDrive%\Windows\System32\slmgr.vbs /rearm if errorlevel==0 ( net stop sppsvc >NUL net start sppsvc >NUL ) ELSE ( GOTO msg ) GOTO loop3 :msg cls echo All rearms have been eliminated... ping -n 5 127.0.0.1 >nul goto mainmenu :EXIT ENDLOCAL exit
Nope, i don't mean skipping a version, but the whole Theme Backup/Restore thingie. As you remember, that caused some trouble, and wasn't ever running 100% properly. Nice idea but i would leave that little part to the user . Cutting it out would make the script easier to maintain, atm with the B/R it's slighly a PITA. SO WHAT I MEAN IS: The wizard should be responsible for properly restoring the Rearm Count and leave the esthetic problem at the users end .
I put task because basically the only consistent, yet very rare problem, is when key would not install due to what I think was the reg runonce and the task has been working great so that's why I changed it I'll go ahead and finish the simplified version I suggested I would and let you check that out and test it...
BIG EYES as answer . Only asked to skip the Theme part.....as this are only few clicks for the user. Would make it much easier, but your choice.
I understand you have a good point, but I've fallen in love with the theme restore and did the personalization window open/close so I'm kinda attached to it for the moment I'll be done with this version I promised soon so let's take everything into consideration before we're committed to doing my original request, my no reinstall version or your idea Thanks
Could be done as different task if the user wishes, departed from the Checking stuff. The Personalisation window can still be opened automatically. I change my theme options and backup/restore myself, so never had the need for a tool to do this. Would guess there are others who see it likewise. But the Rearm should work when promised .
Do you know how to get the message to pop up and stay up? Code: echo :UninstallIR7>>%SystemDrive%\Trial\IR7\IR7.bat echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Activation" /v NotificationDisabled /t REG_DWORD /d 0 /f ^>NUL >>%SystemDrive%\Trial\IR7\IR7.bat echo schtasks /delete /tn "IR7" /f ^>NUL 2>&1 >>%SystemDrive%\Trial\IR7\IR7.bat echo schtasks /delete /tn "Hybrid2" /f ^>NUL 2>&1 >>%SystemDrive%\Trial\IR7\IR7.bat echo schtasks /delete /tn "Hybrid3" /f ^>NUL 2>&1 >>%SystemDrive%\Trial\IR7\IR7.bat echo schtasks /query ^| FINDSTR /I "IORRT" ^>NUL >>%SystemDrive%\Trial\IR7\IR7.bat echo IF ERRORLEVEL 1 ( >>%SystemDrive%\Trial\IR7\IR7.bat echo GOTO TrialFolderDelete >>%SystemDrive%\Trial\IR7\IR7.bat echo ) ELSE ( >>%SystemDrive%\Trial\IR7\IR7.bat echo GOTO IR7FolderDelete >>%SystemDrive%\Trial\IR7\IR7.bat echo ) >>%SystemDrive%\Trial\IR7\IR7.bat echo :TrialFolderDelete>>%SystemDrive%\Trial\IR7\IR7.bat echo echo rd /s /q %SystemDrive%\Trial ^>NUL ^>^>%SystemDrive%\removeTrial.bat >>%SystemDrive%\Trial\IR7\IR7.bat echo echo schtasks /delete /tn "removeTrial" /f ^>NUL ^>^>%SystemDrive%\removeTrial.bat >>%SystemDrive%\Trial\IR7\IR7.bat echo echo del /F /Q %SystemDrive%\removeTrial.bat ^>nul ^>^>%SystemDrive%\removeTrial.bat >>%SystemDrive%\Trial\IR7\IR7.bat echo schtasks /create /tn "removeTrial" /tr "%SystemDrive%\removeTrial.bat" /sc onlogon /ru "" ^>NUL >>%SystemDrive%\Trial\IR7\IR7.bat echo schtasks /run /tn "removeTrial" ^>NUL >>%SystemDrive%\Trial\IR7\IR7.bat echo GOTO Messagebox >>%SystemDrive%\Trial\IR7\IR7.bat echo :IR7FolderDelete>>%SystemDrive%\Trial\IR7\IR7.bat echo echo rd /s /q %SystemDrive%\Trial\IR7 ^>NUL ^>^>%SystemDrive%\removeIR7.bat >>%SystemDrive%\Trial\IR7\IR7.bat echo echo schtasks /delete /tn "removeIR7" /f ^>NUL ^>^>%SystemDrive%\removeIR7.bat >>%SystemDrive%\Trial\IR7\IR7.bat echo echo del /F /Q %SystemDrive%\removeIR7.bat ^>nul ^>^>%SystemDrive%\removeIR7.bat >>%SystemDrive%\Trial\IR7\IR7.bat echo schtasks /create /tn "removeIR7" /tr "%SystemDrive%\removeIR7.bat" /sc onlogon /ru "" ^>NUL >>%SystemDrive%\Trial\IR7\IR7.bat echo schtasks /run /tn "removeIR7" ^>NUL >>%SystemDrive%\Trial\IR7\IR7.bat echo GOTO Messagebox >>%SystemDrive%\Trial\IR7\IR7.bat echo :Messagebox>>%SystemDrive%\Trial\IR7\IR7.bat echo echo set args=WScript.Arguments ^>msgbox.vbs >>%SystemDrive%\Trial\IR7\IR7.bat echo echo wscript.quit MsgBox(Replace(Replace(args.item(1),"{cr}",vbNewLine,1,-1,1),"{qt}",Chr(34),1,-1,1),args.item(2),args.item(0)) ^>^>msgbox.vbs >>%SystemDrive%\Trial\IR7\IR7.bat echo echo msgbox.vbs "IR7" "Your 180 day free trial has ended, please install IR7 again!" 64 >>%SystemDrive%\Trial\IR7\IR7.bat echo IF %%ERRORLEVEL%% EQU 6 del /s /q msgbox.vbs ^>nul ^&^& goto exit>>%SystemDrive%\Trial\IR7\IR7.bat echo :exit >>%SystemDrive%\Trial\IR7\IR7.bat echo exit >>%SystemDrive%\Trial\IR7\IR7.bat Basically I want it to uninstall IR7 and give message with an ok button to close msg box so user knows that day 180 is here... Is the errorlevel right? Any help? Thanks