As far as my last post goes, I think the purple text needs to be called once the script (Duality, IR6, or Check) checks the rearm count. Here is a check.bat excerpt. Code: wmic path %spp% get LicenseStatus /format:list 2>nul | findstr /i 5 >nul 2>&1 if %errorlevel%==0 goto :Rearm if %errorlevel%==1 goto :Backup :Backup echo F | xcopy "%themefile%" "%IR6backup%\IR6Bkup.theme" /Y >NUL goto :Exit :Rearm echo: 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 :Reinstall 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 ) echo F | xcopy "%themefile%" "%IR6backup%\IR6Bkup.theme" /Y >NUL reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes" /t REG_SZ /v CurrentTheme /d "C:\Windows\resources\Themes\IR6Bkup.theme" /f >NUL %IR6backup%\IR6Bkup.theme goto :Exit :ReinstallIR6 msgbox.vbs "Duality 420" "Your 180 day free trial has ended, do you wish to install IR6 again?" 4 IF %ERRORLEVEL% EQU 6 (GOTO reinconfirm) ELSE (IF %ERRORLEVEL% EQU 7 (GOTO UninstallIR6)) :reinconfirm CLS REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Activation" /v NotificationDisabled /t REG_DWORD /d 0 /f >NUL
Need to change this to IF %ERRORLEVEL% EQU 6 (call :ReinstallIR6) ELSE (IF %ERRORLEVEL% EQU 7 (call :UninstallIR6)) or as Humphrey mentioned use GOTO
Got to do something be back in little while to do rearm folder stuff and finish off adding Check.bat to IR6 install and Check.bat to Check.bat IR6 re-install ...lol
Code: msgbox.vbs "Duality 420" "Your 180 day free trial has ended, do you wish to install IR6 again?" 4 This is the only part prompting an error that command is either wrong written or couldnĀ“t be found .
This is true, OR!, make it create the msgbox.vbs with an echo. output. Make sure its in the %systemdrive%\Rearm folder.
Code: ::reinstall choice :Messagebox echo set args=WScript.Arguments >msgbox.vbs 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 msgbox.vbs "Duality 420" "Your 180 day free trial has ended, do you wish to install IR6 again?" 4 if exist msbox.vbs del /s /q msgbox.vbs >nul IF %ERRORLEVEL% EQU 6 call :ReinstallIR6 IF %ERRORLEVEL% EQU 7 call :UninstallIR6 That way it works for me .
Files that will be in Rearm folder: Code: Backup folder IORRT.bat Check.bat IR6Bkup.theme >>> will be in Backup folder msgbox.vbs >>> is created on the fly and deleted afterwards .
I only meant that he used that in his previous code Everyone knew it was you who referred it..There is no question of leaving you behind, this is your thread and this is your project, we are just helping what we can..
Ok but I'd rather not spend time doing it if you already have it done...lol So am I going to put stuff in D420 and Check.bat or are you guys cause there's no reason for both us to do it...lol Can I finish D420 and Check.bat or let you? I'm ok with either just want to know cause you guys are tearing it up in a good way...lol I know just feel like we're going the speed of light and I am on ten speed ...lol Thanks
@slave77 please clear out your inbox as it is quite full OMG Humphrey doesn't want to be friends like slave77 ...lol Carlos Everyone else except nazi's
Here is code to make folder and file create in location that will go in D420 and Check.bat IR6reinstall Notice what has >nul or not? set/mkdir/if/schtask/echo/RD stuff = No IORRT code Code: SET file=%SystemDrive%\Check IF EXIST %file% attrib -h %file% RD /S /Q %file% mkdir "%SystemDrive%\IORRT" net stop osppsvc >NUL xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\IORRT\Backup\Files\Tokens" >NUL mkdir "%SystemDrive%\IORRT\Backup\Registry" reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup\Registry\OfficeSPPInfo.hiv >NUL net start osppsvc >NUL SET file=%SystemDrive%\IORRT\IORRT.bat IF EXIST %file% attrib -h %file% echo @echo off >%file% echo net stop osppsvc >>%file% echo xcopy /cheriky "%SystemDrive%\IORRT\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" >>%file% echo REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file% echo REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file% echo reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup\Registry\OfficeSPPInfo.hiv >>%file% echo net start osppsvc >>%file% echo IF Exist "%ProgramFiles%\Microsoft Office\Office15\OSPPREARM.exe" ( >>%file% echo "%ProgramFiles%\Microsoft Office\Office15\OSPPREARM.exe" >>%file% echo ) ELSE ( "%programfiles(x86)%\Microsoft Office\Office15\OSPPREARM.exe" >>%file% echo ) >>%file% echo schtasks /delete /tn "IORRT" /f >>%file% echo schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru "" >>%file% IR6 code Code: SET file=%sd%\IR6.bat echo @echo off>>%file% echo echo Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") ^>^>drive.vbs>>%file% echo echo Set colItems = objWMIService.ExecQuery( "SELECT * FROM Win32_Volume",,48) ^>^>drive.vbs>>%file% echo echo For Each objItem in colItems ^>^>drive.vbs>>%file% echo echo If Hex(%sn%) = Hex(objItem.SerialNumber) then ^>^>drive.vbs>>%file% echo echo Wscript.Echo objItem.DriveLetter ^>^>drive.vbs>>%file% echo echo End If ^>^>drive.vbs>>%file% echo echo Next ^>^>drive.vbs>>%file% echo for /f %%%%A IN ('"cscript /nologo drive.vbs"') do set dl=%%%%A>>%file% echo set dl=%%dl:~0,-1%%>>%file% echo del drive.vbs>>%file% echo reg load HKLM\MY_SYSTEM "%%dl%%\Windows\System32\config\system" ^>NUL >>%file% echo reg delete HKLM\MY_SYSTEM\WPA /f ^>NUL >>%file% echo reg unload HKLM\MY_SYSTEM ^>NUL >>%file% echo echo cscript /b slmgr.vbs /ipk %PIDKEY% ^>%%dl%%\installkey.bat >>%file% echo echo slmgr.vbs /dlv ^>^>%%dl%%\installkey.bat >>%file% echo echo del "C:\installkey.bat" ^>^>%%dl%%\installkey.bat >>%file% echo echo CreateObject("WScript.Shell").Run """C:\installkey.bat""", 0, False ^>%%dl%%\key.vbs >>%file% echo echo @echo off ^>%%dl%%\launch.bat >>%file% echo echo wscript.exe "C:\key.vbs" ^>^>%%dl%%\launch.bat >>%file% echo echo del "%sd%\IR6.bat" ^>^>%%dl%%\launch.bat >>%file% echo echo del "C:\key.vbs" ^>^>%%dl%%\launch.bat >>%file% echo echo del "C:\launch.bat" ^>^>%%dl%%\launch.bat >>%file% echo reg load HKLM\MY_SOFTWARE "%%dl%%\Windows\System32\config\software" ^>NUL >>%file% echo reg add HKLM\MY_SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v InstallKey /t REG_SZ /d C:\launch.bat ^>NUL >>%file% echo reg unload HKLM\MY_SOFTWARE >>%file% echo wpeutil reboot >>%file% Go at it
So logic is this For either IR6/IORRT Install Code: If Rearm folder exists, don't create put stuff in Rearm folder If Rearm folder doesn't exist, create rearm folder put stuff in Rearm folder Uninstall Code: Upon uninstall if opposite program stuff is in Rearm the don't delete Rearm folder or opposite stuff Delete current program stuff Slave77 will check for rearms/notifications via 0 rearms ...lol Ha ha just kidding We could have done my rearm error check but yours is more modern less Neanderthal like my idea