Hi everyone, I have been trying to develop a batch script for SetupComplete.cmd for Windows to detect enterprise edition and to skip Daz's Windows Loader but have yet to have anything. Daz and I have been msging back and forth trying to figure something out. No matter how I script it, It always passes over every Windows Edition and does not activate any whatsoever. Any Help is appreciated
Sorry I haven't gotten back to you Daz. I tried inserting the last code you gave me and inserted it into SetupComplete.cmd and it just never activated any version at all even tho you gave me the code for it to skip over the Enterprise edition, it skipped over every edition of Windows. I have been testing rigorously in VMWare and when i set the credentials at the end of setup, the loader launches and it just hangs. I have to reset the VM to get to the desktop
I have been trying something like this, but it never seems to run the loader. Code: @echo off ::check activation status, and exit:: WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul IF ERRORLEVEL 1 goto :NOT_LICENSED ::run loader, if not activated:: :NOT_LICENSED for /f "tokens=2 delims==" %%A in ('"WMIC OS LIST BRIEF /format:list"') do set os=%%A if %os% equ 5.1.2600 goto:xp if %os% equ 6.0.6002 goto:vista if %os% equ 6.1.7600 goto:windows7 if %os% equ 6.2.9200 goto:windows8 :xp goto :end :vista %~dp0WindowsLoader.exe /silent /preactivate >nul goto :end :windows7 %~dp0WindowsLoader.exe /silent /preactivate >nul goto :end :windows8 goto :end :end exit /b
This is the line of code I used. It skips over the loader no matter what edition Windows is installed: ::check activation:: WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul IF ERRORLEVEL 1 goto :NOT_LICENSED ::all processing finished, delete used files, and EXIT:: :CLEANUP DEL /F /Q %0% >nul EXIT ::windows loader is required for this system: :NOT_LICENSED %RQR% | findstr /I "ENTERPRISE" GOTO :CLEANUP %~dp0"Windows Loader.exe" /silent /preactivate >nul cd %~dp0 attrib -R -A -S -H *.* DEL /F /Q %~dp0"Windows Loader.exe" >nul DEL /F /Q %0% >nul
I've fixed the loader executing on enterprise. It'll be in the next version which I may release soon.
@anarchist9027... @HALIKUS... This should work... Code: @echo off SET INL=IF NOT ERRORLEVEL 1 SET RQR1=REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "ProductName" SET RQR2=REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionId" :ACTIVATION ::check Activation -> goto :CLEANUP (if activated) 2>NUL WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul && %INL% goto :CLEANUP :OS ::check OS '7 or Vista' -> goto :CLEANUP (if not 7 or Vista) %RQR1% | findstr /I "WINDOWS" | findstr /I "7" >nul && %INL% goto :EDITION %RQR1% | findstr /I "WINDOWS" | findstr /I "VISTA" >nul && %INL% goto :EDITION goto :CLEANUP :EDITION ::check Edition -> goto :CLEANUP (if Enterprise) %RQR2% | findstr /I "ENTERPRISE" >nul && %INL% goto :CLEANUP :EFI ::check for 'efisys' status in list volume function -> goto :CLEANUP (if EFI mounted) setlocal enabledelayedexpansion echo list volume >%WINDIR%\Setup\Scripts\listvol.tmp for /F "tokens=6-9 delims= " %%G IN ('diskpart /s %WINDIR%\Setup\Scripts\listvol.tmp') DO IF /I %%G==efisys set mounted=%%J if '%mounted%'=='Healthy' goto :CLEANUP endlocal :LOADER ::run 'loader', reboot, clean %~dp0"Windows Loader.exe" /silent /preactivate cd %~dp0 attrib -R -A -S -H *.* SHUTDOWN /R /T 5 RD /S /Q "%WINDIR%\Setup\Scripts" >nul DEL /F /Q %0% >nul :CLEANUP ::skip 'loader', clean RD /S /Q "%WINDIR%\Setup\Scripts" >nul DEL /F /Q %0% >nul
Thanks for that, DAZ. Thanks searchengine, it LOOKS perfect and like it should work, but it just skips the loader for me also. It must be the OS detection part. I will run it through VMware a few times with echo=on and a few pauses thrown in to try and see where it fails. I especially like the EFI part. Im also going to try a "%RQR1% | findstr /I "WINDOWS" | findstr /I "8" >nul && %INL% goto :CLEANUP" I wonder if it has anything to do with renaming my install.wim entry names or the fact i have Win7 and 8 mixed together. Also, your script runs properly from desktop, but not from OOBE.cmd or setupcomplete.cmd.
@anarchist9027... @HALIKUS... edit 'LOADER' section of SetupComplete.cmd... FROM... Code: :LOADER ::run 'loader', reboot, clean %~dp0"Windows Loader.exe" /silent /preactivate cd %~dp0 attrib -R -A -S -H *.* SHUTDOWN /R /T 5 RD /S /Q "%WINDIR%\Setup\Scripts" >nul DEL /F /Q %0% >nul TO... Code: :LOADER ::run 'loader', reboot, clean call "%WINDIR%\Setup\Scripts\Windows Loader.exe" /silent /preactivate >nul SHUTDOWN /R /T 5 RD /S /Q "%WINDIR%\Setup\Scripts" >nul DEL /F /Q %0% >nul This will run 'Loader' from full path name, and hopefully eliminate error... when I get a chance I will run a test install in VMware. Edit:- added edited 'SetupComplete.cmd' to Win 7 iso, and installed 'Ultimate' edition in VMware Workstation (with un-modded bios)... 'Loader' ran and activated system as 'Asus'.
I just want to stress the point, do not try the above unless its in a VM \ Virtual machine, unless you understand coding. My approach strays from the various methods released and will quite frankly be useless unless you know how to change certain variables. Its more a proof of concept for those who matter (no offense if "you don't matter ).. The above, if run won't be catastrophic, but may very well cause annoyances or not compile at all (more than likely). Especially my Firstlogon.exe. Searchengins setupcomplete.cmd will more than suffice for the average joe, and should be used by the masses in an $OEM$ folder and loader scenario. I am an amateur coder that just wants to "git er done", and steal, and reverse engineer from the greats. Its also a long weekend, so i will not be around until Wednesday of next week. I hope all goes well. Ill take a look see then to see if theres any developments. The way this thread is developing has saved me alot of headaches.