Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Question about XP Versions

- - - - -

  • Please log in to reply
1 reply to this topic

#1
rkillcrazy

rkillcrazy

    Newbie

  • Member
  • 25 posts
Perhaps this query is a bit odd but maybe I'm not the only one....

I have a multiboot DVD that was created with PowerPacker and it's set to run a batch file in the GuiRunOnce section of my WINNT.SIF file. The batch runs just fine but I have it set to stop and ask questions (via CHOICE.COM/EXE) that deal with version of the OS. Meaning... if I installed XP Home SP2 OEM, and I wanted to copy over the I386 directory, I have to have the batch file stop and ask me what version I installed. At that point I give my answer and it copies over the proper directory. Is there a way to script this by having something check to see what version of XP is installed? I'd settle for something that can tell between XP Home and XP Pro but if it can tell between XP Home SP2 OEM, XP Home SP2 Upgrade, XP Pro SP2-B OEM, XP Pro SP2-C OEM & XP Pro SP2 Upgrade, that would awesome! Let me know...

Note: there's something in PowerPacker that can tell the difference between many of these versions. It may not be able to tell the difference between SP2-B or SP2-C but it knows the difference between Home, Pro, SP2, OEM, Upgrade, et cetera.

02-26-08
1217 EST


How to remove advertisement from MSFN

#2
rkillcrazy

rkillcrazy

    Newbie

  • Member
  • 25 posts

Perhaps this query is a bit odd but maybe I'm not the only one....

I have a multiboot DVD that was created with PowerPacker and it's set to run a batch file in the GuiRunOnce section of my WINNT.SIF file. The batch runs just fine but I have it set to stop and ask questions (via CHOICE.COM/EXE) that deal with version of the OS. Meaning... if I installed XP Home SP2 OEM, and I wanted to copy over the I386 directory, I have to have the batch file stop and ask me what version I installed. At that point I give my answer and it copies over the proper directory. Is there a way to script this by having something check to see what version of XP is installed? I'd settle for something that can tell between XP Home and XP Pro but if it can tell between XP Home SP2 OEM, XP Home SP2 Upgrade, XP Pro SP2-B OEM, XP Pro SP2-C OEM & XP Pro SP2 Upgrade, that would awesome! Let me know...

Note: there's something in PowerPacker that can tell the difference between many of these versions. It may not be able to tell the difference between SP2-B or SP2-C but it knows the difference between Home, Pro, SP2, OEM, Upgrade, et cetera.

02-26-08
1217 EST


Well, since nobody had any ideas, I worked something out... I have a batch file that runs at about T-9 of the WinXP GUI setup. This is done via my WINNT.SIF in the [SetupParams] section. The batch file it runs is below. It does a lot of stuff but the part I made to do the auto-detection is labeled :CMDCONS.

Basically, it queries the registry and looks at the source-paths. Piping that info through a FIND command, I can seek out strings that match the folders on my multi-boot DVD. Then, using error codes, I can direct the script to do my bidding! B)

@ECHO OFF
::#############################################################
::Revised: 16:32 03/28/2008
::#############################################################
::This will add a user account and password.
::Then it will add them to the Administrator's group.
::Then it will copy some data to the desktop. 
::Then it will install the Recovery Console.
::Then it will clean up the files used for this.
::#############################################################



:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 
::
::This adds a user to the administrator's group.
TITLE ADDING USERS
ECHO ADDING SOME USERS...
net accounts /minpwlen:0
net accounts /maxpwage:unlimited
net user Admin home3313 /add
net user User /add
net localgroup Administrators Admin /add
net localgroup Administrators User /add
cls


::This will hide the newly created account.
REG ADD "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\WINLOGON\SPECIALACCOUNTS\USERLIST" /V ADMIN /T REG_DWORD /D 65536 /F
cls
::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 



:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 
::
::I have a bunch of goodies in a couple of 7-Zip files.  Check it out once you reach the desktop!
TITLE GETTING EXTRA DATA
ECHO DUMPING DATA TO THE DESKTOP.  STAND BY...
SETLOCAL
::VARIABLES FOR THIS SECTION
FOR %%I IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%I:\STUFF.7Z SET DVDROM=%%I:
SET SOURCE="\\63.243.104.66\data-80\DO-NOT-DELETE\MULTIBOOT\EXTRAS"
SET DESTINATION="%ALLUSERSPROFILE%\DESKTOP"
SET WHAT=/S /COPY:D
SET OPTIONS=/R:2 /W:2

:REPACKS
ECHO We can try to copy my repacks from a source that may be more up to date.
ECHO The versions on this disk may be a month old or better.
ECHO If anything goes wrong, the versions on the disk will be used.
ECHO.

CHOICE /C:YN /T:Y,45 Try to copy my repacks from a server that may be more up to date? 
IF ERRORLEVEL 2 GOTO UNZIP
IF ERRORLEVEL 1 GOTO SERVER

:SERVER
TITLE PULLING DATA FROM FILE SERVER
IF NOT EXIST %SOURCE% GOTO UNZIP_STUFF
robocopy %SOURCE%\STUFF %DESTINATION%\STUFF %WHAT% %OPTIONS%
IF %ERRORLEVEL%==1 cls && GOTO UNZIP_UPDATES

:UNZIP_STUFF
TITLE EXTRACTING DATA
%SYSTEMDRIVE%\un7zip.exe "%DVDROM%\STUFF.7Z" %DESTINATION%\STUFF

:UNZIP_UPDATES
TITLE EXTRACTING OFFLINE UPDATER
%SYSTEMDRIVE%\un7zip.exe "%DVDROM%\OFFLINEUPDATER.7Z" %DESTINATION%\OFFLINEUPDATER

ECHO The folders on the desktop are full of various hotfixes and apps that are commonly used. > "%ALLUSERSPROFILE%\DESKTOP\INFO.TXT"
ECHO Make sure all drivers were installed. >> "%ALLUSERSPROFILE%\DESKTOP\INFO.TXT"
ECHO Once that's complete, you should activate this machine before proceeding with the material in these folders as several of these apps and updates require activation. >> "%ALLUSERSPROFILE%\DESKTOP\INFO.TXT"
ENDLOCAL
cls
::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 



:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 
::
:CMDCONS
::This will install the Recovery Console as a boot option.
::We'll try to figure out what your OS is.
::We'll need to set a variable here so we can run the install from the CD/DVD.
TITLE RECOVERY CONSOLE
REG QUERY HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SOURCEPATH | FIND /I "XPHO" > NUL
IF %ERRORLEVEL%==0 GOTO HOMEOEM

REG QUERY HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SOURCEPATH | FIND /I "XPHU" > NUL
IF %ERRORLEVEL%==0 GOTO HOMEUPG

REG QUERY HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SOURCEPATH | FIND /I "XPPB" > NUL
IF %ERRORLEVEL%==0 GOTO PROOEMB

REG QUERY HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SOURCEPATH | FIND /I "XPPC" > NUL
IF %ERRORLEVEL%==0 GOTO PROOEMC

REG QUERY HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SOURCEPATH | FIND /I "XPPU" > NUL
IF %ERRORLEVEL%==0 GOTO PROUPG


::#############################################################
:HOMEOEM
SETLOCAL
FOR %%I IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%I:\ROOT\XPHO\I386\WINNT32.EXE SET DVDROM=%%I:
ECHO YOU HAVE XP HOME SP2 (OEM)
ECHO INSTALLING THE RECOVERY CONSOLE AS A BOOT OPTION
START /W %DVDROM%\ROOT\XPHO\I386\WINNT32.EXE /CMDCONS /UNATTEND
cls


::Some people like to have the I386 directory copied over.
ECHO It may be a good idea to copy the I386 directory for later use.
ECHO Changing the sourcepath afterwards is also a good idea.
ECHO I'll do both for you if you wish.
ECHO.
CHOICE /C:YN /T:Y,45 Would you like to copy the I386 Directory? 
IF ERRORLEVEL 2 GOTO NO_HOMEOEM_I386
IF ERRORLEVEL 1 GOTO YES_HOMEOEM_I386

:YES_HOMEOEM_I386
TITLE COPYING THE I386 DIRECTORY
ECHO IF THIS IS WHAT YOU WANTED, GREAT!
ECHO IF NOT, YOU WERE TOO SLOW!
ECHO YOU CAN ALWAYS DELETE THE DIRECTORY FROM THE ROOT OF %SYSTEMDRIVE% LATER.
ROBOCOPY %DVDROM%\ROOT\XPHO\I386 %SYSTEMDRIVE%\I386 /MIR /R:2 /W:2
ECHO CHANGING THE SOURCEPATH
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V ServicePackSourcePath /T REG_SZ /D C:\ /F
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SourcePath /T REG_SZ /D C:\ /F
REG ADD "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION" /V SourcePath /T REG_SZ /D C:\I386 /F

:NO_HOMEOEM_I386
ENDLOCAL
GOTO TIMEOUT


::#############################################################
:HOMEUPG
FOR %%I IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%I:\ROOT\XPHU\I386\WINNT32.EXE SET DVDROM=%%I:
ECHO YOU HAVE XP HOME SP2 (UPGRADE)
ECHO INSTALLING THE RECOVERY CONSOLE AS A BOOT OPTION
START /W %DVDROM%\ROOT\XPHU\I386\WINNT32.EXE /CMDCONS /UNATTEND
cls


::Some people like to have the I386 directory copied over.
ECHO It may be a good idea to copy the I386 directory for later use.
ECHO Changing the sourcepath afterwards is also a good idea.
ECHO I'll do both for you if you wish.
ECHO.
CHOICE /C:YN /T:Y,45 Would you like to copy the I386 Directory? 
IF ERRORLEVEL 2 GOTO NO_HOMEUPG_I386
IF ERRORLEVEL 1 GOTO YES_HOMEUPG_I386

:YES_HOMEUPG_I386
TITLE COPYING THE I386 DIRECTORY
ECHO IF THIS IS WHAT YOU WANTED, GREAT!
ECHO IF NOT, YOU WERE TOO SLOW!
ECHO YOU CAN ALWAYS DELETE THE DIRECTORY FROM THE ROOT OF %SYSTEMDRIVE% LATER.
ROBOCOPY %DVDROM%\ROOT\XPHU\I386 %SYSTEMDRIVE%\I386 /MIR /R:2 /W:2
ECHO CHANGING THE SOURCEPATH
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V ServicePackSourcePath /T REG_SZ /D C:\ /F
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SourcePath /T REG_SZ /D C:\ /F
REG ADD "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION" /V SourcePath /T REG_SZ /D C:\I386 /F

:NO_HOMEUPG_I386
ENDLOCAL
GOTO TIMEOUT


::#############################################################
:PROOEMB
FOR %%I IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%I:\ROOT\XPPB\I386\WINNT32.EXE SET DVDROM=%%I:
ECHO YOU HAVE XP PRO SP2-B (OEM)
ECHO INSTALLING THE RECOVERY CONSOLE AS A BOOT OPTION
START /W %DVDROM%\ROOT\XPPB\I386\WINNT32.EXE /CMDCONS /UNATTEND
cls


::Some people like to have the I386 directory copied over.
ECHO It may be a good idea to copy the I386 directory for later use.
ECHO Changing the sourcepath afterwards is also a good idea.
ECHO I'll do both for you if you wish.
ECHO.
CHOICE /C:YN /T:Y,45 Would you like to copy the I386 directory? 
IF ERRORLEVEL 2 GOTO NO_PROOEMB_I386
IF ERRORLEVEL 1 GOTO YES_PROOEMB_I386

:YES_PROOEMB_I386
TITLE COPYING THE I386 DIRECTORY
ECHO IF THIS IS WHAT YOU WANTED, GREAT!
ECHO IF NOT, YOU WERE TOO SLOW!
ECHO YOU CAN ALWAYS DELETE THE DIRECTORY FROM THE ROOT OF %SYSTEMDRIVE% LATER.
ROBOCOPY %DVDROM%\ROOT\XPPB\I386 %SYSTEMDRIVE%\I386 /MIR /R:2 /W:2
ECHO CHANGING THE SOURCEPATH
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V ServicePackSourcePath /T REG_SZ /D C:\ /F
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SourcePath /T REG_SZ /D C:\ /F
REG ADD "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION" /V SourcePath /T REG_SZ /D C:\I386 /F

:NO_PROOEMB_I386
ENDLOCAL
GOTO TIMEOUT


::#############################################################
:PROOEMC
FOR %%I IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%I:\ROOT\XPPC\I386\WINNT32.EXE SET DVDROM=%%I:
ECHO YOU HAVE XP PRO SP2-C (OEM)
ECHO INSTALLING THE RECOVERY CONSOLE AS A BOOT OPTION
START /W %DVDROM%\ROOT\XPPC\I386\WINNT32.EXE /CMDCONS /UNATTEND
cls


::Some people like to have the I386 directory copied over.
ECHO It may be a good idea to copy the I386 directory for later use.
ECHO Changing the sourcepath afterwards is also a good idea.
ECHO I'll do both for you if you wish.
ECHO.
CHOICE /C:YN /T:Y,45 Would you like to copy the I386 Directory? 
IF ERRORLEVEL 2 GOTO NO_PROOEMC_I386
IF ERRORLEVEL 1 GOTO YES_PROOEMC_I386

:YES_PROOEMC_I386
TITLE COPYING THE I386 DIRECTORY
ECHO IF THIS IS WHAT YOU WANTED, GREAT!
ECHO IF NOT, YOU WERE TOO SLOW!
ECHO YOU CAN ALWAYS DELETE THE DIRECTORY FROM THE ROOT OF %SYSTEMDRIVE% LATER.

ROBOCOPY %DVDROM%\ROOT\XPPC\I386 %SYSTEMDRIVE%\I386 /MIR /R:2 /W:2
ECHO CHANGING THE SOURCEPATH
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V ServicePackSourcePath /T REG_SZ /D C:\ /F
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SourcePath /T REG_SZ /D C:\ /F
REG ADD "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION" /V SourcePath /T REG_SZ /D C:\I386 /F

:NO_PROOEMC_I386
ENDLOCAL
GOTO TIMEOUT


::#############################################################
:PROUPG
FOR %%I IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%I:\ROOT\XPPU\I386\WINNT32.EXE SET DVDROM=%%I:
ECHO YOU HAVE XP PRO SP2 (UPGRADE)
ECHO INSTALLING THE RECOVERY CONSOLE AS A BOOT OPTION
START /W %DVDROM%\ROOT\XPPU\I386\WINNT32.EXE /CMDCONS /UNATTEND
cls


::Some people like to have the I386 directory copied over.
ECHO It may be a good idea to copy the I386 directory for later use.
ECHO Changing the sourcepath afterwards is also a good idea.
ECHO I'll do both for you if you wish.
ECHO.
CHOICE /C:YN /T:Y,45 Would you like to copy the I386 Directory? 
IF ERRORLEVEL 2 GOTO NO_PROUPG_I386
IF ERRORLEVEL 1 GOTO YES_PROUPG_I386

:YES_PROUPG_I386
TITLE COPYING THE I386 DIRECTORY
ECHO IF THIS IS WHAT YOU WANTED, GREAT!
ECHO IF NOT, YOU WERE TOO SLOW!
ECHO YOU CAN ALWAYS DELETE THE DIRECTORY FROM THE ROOT OF %SYSTEMDRIVE% LATER.
ROBOCOPY %DVDROM%\ROOT\XPPU\I386 %SYSTEMDRIVE%\I386 /MIR /R:2 /W:2
ECHO CHANGING THE SOURCEPATH
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V ServicePackSourcePath /T REG_SZ /D C:\ /F
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\SETUP /V SourcePath /T REG_SZ /D C:\ /F
REG ADD "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION" /V SourcePath /T REG_SZ /D C:\I386 /F

:NO_PROUPG_I386
ENDLOCAL
GOTO TIMEOUT
::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 



:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 
::
:TIMEOUT
cls
TITLE TWEAKING BOOT TIMER
BOOTCFG /TIMEOUT 05
GOTO CLEANUP
::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 



:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: 
::
:CLEANUP
cls
:: Cleans up a few things.
ECHO @ECHO OFF > "%SYSTEMDRIVE%\FINISH.CMD"
ECHO TITLE CLEANING UP DESKTOP.INI FILES >> "%SYSTEMDRIVE%\FINISH.CMD"
ECHO ECHO FOR SOME REASON YOU'LL SEE COPIES OF DESKTOP.INI IN YOUR START MENU. >> "%SYSTEMDRIVE%\FINISH.CMD"
ECHO ECHO THESE FILES ARE NORMALLY HIDDEN. >> "%SYSTEMDRIVE%\FINISH.CMD"
ECHO ECHO THIS BATCH FILE WILL FIX THAT ISSUE. >> "%SYSTEMDRIVE%\FINISH.CMD"
ECHO ATTRIB +S +H "%SYSTEMDRIVE%\DESKTOP.INI" /S >> "%SYSTEMDRIVE%\FINISH.CMD"
ECHO CSCRIPT EJECT-DVD.VBS >> "%SYSTEMDRIVE%\FINISH.CMD"
ECHO DEL %%0 >> "%SYSTEMDRIVE%\FINISH.CMD"
REG ADD HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUNONCE /V FINISH /T REG_SZ /D %SYSTEMDRIVE%\FINISH.CMD /F
IF EXIST %SYSTEMDRIVE%\un7zip.exe DEL /Q %SYSTEMDRIVE%\un7zip.exe
IF EXIST %SYSTEMDRIVE%\7-zip32.dll DEL /Q %SYSTEMDRIVE%\7-zip32.dll
DEL %0
::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN