Windows Loader and Windows 7 AIO w/ Enterprise

Discussion in 'Windows 7' started by anarchist9027, Aug 22, 2012.

  1. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    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 :biggrin:
     
  2. Daz

    Daz MDL Developer / Admin
    Staff Member

    Jul 31, 2009
    9,303
    66,110
    300
    I've not received any new private messages to say if it had worked or not, but I know that it does work from SetupComplete.cmd as I've tested execution from it myself.

    What did get me thinking is that you shouldn't need to prevent Enterprise specifically as the application will quit automatically when Enterprise is detected anyway.

    http://forums.mydigitallife.net/thr...on)-Activation?p=611661&viewfull=1#post611661
    http://forums.mydigitallife.net/thr...vation/page116?p=586807&viewfull=1#post586807
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    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
     
  4. HALIKUS

    HALIKUS MDL Addicted

    Jul 29, 2009
    527
    369
    30
    #4 HALIKUS, Aug 23, 2012
    Last edited by a moderator: Apr 20, 2017
    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
    
     
  5. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    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
     
  6. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    *bump* *bump*
     
  7. Daz

    Daz MDL Developer / Admin
    Staff Member

    Jul 31, 2009
    9,303
    66,110
    300
    I've fixed the loader executing on enterprise. It'll be in the next version which I may release soon.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    Sounds good Daz, Cant wait :worthy:
     
  9. searchengine

    searchengine Guest

    #9 searchengine, Aug 25, 2012
    Last edited by a moderator: Apr 20, 2017
    @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
     
  10. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    I will have to test this out when I get the chance, thanks serchengine for sharing +1
     
  11. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    #11 anarchist9027, Aug 28, 2012
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Your script doesn't work. It skips Windows Loader activation completely on any edition of Windows

     
  12. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    *Bump* *Bump*
     
  13. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    *Bump* *Bump* again :help2:
     
  14. HALIKUS

    HALIKUS MDL Addicted

    Jul 29, 2009
    527
    369
    30
    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.
     
  15. searchengine

    searchengine Guest

    #15 searchengine, Aug 31, 2012
    Last edited by a moderator: Apr 20, 2017
    @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'.
     
  16. BobSheep

    BobSheep Moderator
    Staff Member

    Apr 19, 2010
    2,326
    1,358
    90
    You should've posted this in the Windows Loader thread then no need to bump. Your fault.
     
  17. HALIKUS

    HALIKUS MDL Addicted

    Jul 29, 2009
    527
    369
    30
    #17 HALIKUS, Sep 1, 2012
    Last edited by a moderator: Apr 20, 2017
  18. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    #18 anarchist9027, Sep 1, 2012
    Last edited by a moderator: Apr 20, 2017
    (OP)
  19. HALIKUS

    HALIKUS MDL Addicted

    Jul 29, 2009
    527
    369
    30
    #19 HALIKUS, Sep 2, 2012
    Last edited: Sep 2, 2012
    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.