lol...We're not trying to errorlevel IR6 code just get Check.bat at start up to check if in notifications Hence two files 1. D420 program 2. Check.bat that is placed in systemdrive that is triggered by Hybrid2 task Hence D420 would never scan for notifications. IR6 installs temporary IR5.bat file in systemdrive that when in RE enables WPA key to be deleted, then upon restart default OS key is installed and IR5.bat is deleted Check.bat never gets deleted unless IR6 is uninstalled We're not trying to code IR6 yet just the Check.bat it creates and places in %systemdrive% upon installation Hybrid2 task is also no problem installing
Ok, we don't want D420 to do anything but install IR6 or uninstall IR6 which means uninstall all tasks, reg anti-notification setting and Check.bat What happens after that is of consequence If one we're to go back to my Check.bat one would see that if error then rearm, then re-create 30 day IR6 task, if no error then exit, if can't rearm give re-install IR6 from D420 console Imagine IR6 creates two files, actually more but forget about that now. It creates the main delete WPA key IR5.bat in systemdrive AND Check.bat IR5.bat gets run in RE then upon reboot creates a key install .bat then deletes both IR5.bat and key install bat and another bat but forget about that for now Important thing is the Check.bat...lol It has code in whatever concept? to have rearm happen at start up if past 30 days that IR6 task runs in 30 duration cycle @Humphrey We don't need to put anything in IR6 code yet I have that code already ONLY code that needs developing is Check.bat with how to detect if in notifications by WHATEVER means Check.bat Code: @echo off title IR6 mode con: cols=50 lines=12 REM check if in notifications however? IF ERRORLEVEL 0 ( goto exit >NUL echo. ) ELSE ( schtasks /run | FINDSTR /i "IR6" >nul 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 REM restore %appdata%\Microsoft\Windows\Theme >NUL goto exit ) IF ERRORLEVEL 1 ( echo It is time to re-install IR6... & pause & goto exit ) ELSE ( ) :Exit exit
Doesn't "cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "0xC004F056"" check to see if 0xC004F056 is in slmgr, and didn't we just conclude that if 0xC004F056 is in slmgr that its in notification status? And as far as I know, the little bit of code below, ran from inside Duality 420, WILL create your Check.bat. If you looked on down you see that I also added the line for adding hybrid2 task and where it would delete hybrid and check.bat. Code: ECHO cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "0xC004F056" >nul >>%windir%\System32\Check.bat ECHO IF ERRORLEVEL 1 ( goto exit >>%windir%\System32\Check.bat ECHO ) ELSE ( >>%windir%\System32\Check.bat ECHO 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 >>%windir%\System32\Check.bat ECHO goto :eof >>%windir%\System32\Check.bat ECHO ) >>%windir%\System32\Check.bat ECHO IF ERRORLEVEL 1 ( echo It is time to re-install IR6... & pause & goto exit >>%windir%\System32\Check.bat ECHO ) ELSE ( >>%windir%\System32\Check.bat ECHO ) >>%windir%\System32\Check.bat ECHO :Exit >>%windir%\System32\Check.bat ECHO exit >>%windir%\System32\Check.bat
Only thing that I KNOW that could be wrong with the Duality 420 bat I post is the second error level where it indicates if it was able to rearm or not and ask for IR6 to be reinstalled. __ I will note that the part where it echos out the check.bat isn't functioning correctly. For some reason it stops half way down. @ s1ave77 - what? I am not very good with errorlevel's yet so I am not even sure if mine is right but with a little correction all should be working well.
Correct, I forgot about i18n. Mea culpa. The error code should be the same for all languages, though.
So that is two methods of detecting Notifications status that will (should) work with what you want. Which do you prefer cause they both seem to function no mater what language is being used? As the "restore theme/background" goes, still haven't gotten notification status so I have NO idea whats done with the background/theme so looks like it will be about 29 days till then if I have to wait for notification status so appear. As you see below, I executed that line without the GREEN section, what exactly is that for? (I see now ) Code: My computer, being licensed shows 1 instead of 5. Doesn't find the "5" character (Looking for notification status) C:\Users\Cody>wmic path SoftwareLicensingProduct get LicenseStatus /format:list 2>nul | findstr /i 5 >nul 2>&1 C:\Users\Cody>echo %errorlevel% 1 Does find the "1" character (Looking for Licensee status) C:\Users\Cody>wmic path SoftwareLicensingProduct get LicenseStatus /format:list 2>nul | findstr /i 1 >nul 2>&1 C:\Users\Cody>echo %errorlevel% 0
Yes, so you got 1 (false) => Your system is not in Notifications mode For second one you used '1' = Licensed and so the wmi query returns errorlevel '0' (true) I took that example from my KMS_VL_ALL script, it is used to check for OEM activated Windows..
Hi Humphrey, I think the WMIC is the best but we have other to go to if we need backup plan? Notification can be forced via activating then deactivating or by other means I forgot. It is funny how we get notifications but forget how we got there? Notifications is not just end of trial situation but if OS has detected piracy, etc... You could just set desktop to black and then test a restore code. I think it's pretty creative space on how to restore theme/background and it will come to us how to do it We will go with detection of notifications 5 as it just dumps to exit if not in notifications, if in 5 then 3 actions are done in the order I put them 1. Restore theme 2. Create task 3. Rearm This way error check after rearm if can't rearm is easy way to give message Code is really simple as is Hybrid2 task code also simple hence "eliminate manual rearm" concept is really simple Just need to work on description part then we'll start testing
A couple of things, checks not needed for Win 8 as D420 does not work on Win 8, and for Win 7 no need to check which License Model it is activated, irrespective of Win 7 edition, IR6 only checks for the no. of re-arms available. So, as Humphrey tested previously, just wmic path %spp% get LicenseStatus for 5 should be sufficient i think..
All those channels can be in trial? Can we bypass checking channels? I think things got a little complicated? Upon restart if can't rearm that means Trial is at end of last 30 days so day 180 is given message otherwise we don't want too much communication, just a simple check at startup If not in notifications simply exit If yes in notifcations: A. Restore background image B. Create 30 day IR6 task C. Rearm Then because rearm is last cmd if errors then give message. No other message is needed or wanted as my "eliminate manual rearm" concept should be silent and only on day 180 + should notice be given! So I think this format is easier and have added some things Code: @echo off title IR6 mode con: cols=50 lines=12 setlocal enabledelayedexpansion set spp=SoftwareLicensingProduct wmic path %spp% get LicenseStatus /format:list 2>nul | findstr /i 5 >nul 2>&1 if %errorlevel% EQU 0 ( REM Insert "restore theme/background" concept here 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 "'%SystemDrive%\Windows\system32\cmd.exe' /c cscript.exe /b %SystemDrive%\Windows\System32\slmgr.vbs /rearm && net stop sppsvc && net start sppsvc" >NUL goto exit ) if %errorlevel% EQU 1 ( echo Re-install IR6 now... & pause & goto exit ) endlocal :Exit exit If I am wrong let me know I just don't think we need to know how many rearms are present just do actions and let errorlevel react or not? Thanks gewpal, appreciate your ongoing assistance with D420 Yes as Cody says Win 8 trial is useless and I wouldn't want to support W8 Also thought no need to check license model IR6 actually never checks for rearms except when using status option I agree and will consider testing Check.bat today
I think something is being missed here, so I'll try to iterate I believe there is no need to check rearms cause 1. If in notifications we have to rearm to get out of it 2. If can't rearm, is because status is 0 rearms which means last rearm was done 30 days ago 3. Hence need to check rearms is unnecessary 4. We have to make sure when get can't rearm error gives msg Also since Hybrid2 task runs Check.bat silently like IORRT's Hybrid task runs IORRT.bat, it is only necessary to have "message" appear to re-install IR6 That aspect of Check.bat might need some re-designing as Check.bat runs silent but also at day 180 + message needs to be given I'd like to maybe consider giving real windows message as that way Check.bat won't have to be silent yet produce an message console
Well lets first start off with what IR6 does When install W7 it shows 3 rearm and 30 days IR6 when installed deletes WPA key with sp1 gives 5 rearms 30 days = 180 days of trial/testing So rearm 1, 2, 3, 4, 5 still leaves 30 days even though status check will show 0 rearms there is still 30 days left So at end of last day of last 30 days it will not be able to rearm and is in notifications In checking via rearms there is uncertainty about extra 30 days left I think my logic is correct
Only in case you´d check generally for Rearm Count. In my example it only checks, when system is in Notification, so there can´t be any days left. As long system is in OOBE Grace, check for Notification fails and script exits.
This Code: @echo off setlocal ENABLEEXTENSIONS set KEY_NAME=HKCU\Software\Microsoft\Command Processor set VALUE_NAME=DefaultColor for /F "usebackq tokens=3" %%A IN (`reg query "%KEY_NAME%" /v "%VALUE_NAME%" 2^>nul ^| find "%VALUE_NAME%"`) do ( echo %%A ) pause Out puts 0x0F, I need it to give me just the 0F (skipping the 0x.) HALP