Jump to content


  • Posts

  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Posts posted by WreX

  1. bcdedit -create {ntldr} /d "Windows XP"

    bcdedit -set {ntldr} device partition=x:

    bcdedit -set {ntldr} path \ntldr

    bcdedit -displayorder {ntldr} -addfirst

    bcdedit -timeout 10

    bcdedit -default {ntldr}

    You don't need to specify the partition for NTLDR, C:\BOOT.INI determines what partition XP will boot from. I use the command "bcdedit -set {ntldr} device boot".

  2. My only solution was to run a batch file during the first boot and login after SysPrep to reconfigure my BCD entry. I decided on a static GUID so I wouldn't have to keep track of dynamic ones. Here's what I run from the batch file to re-install my entry:

    bcdedit -set {ramdiskoptions} ramdisksdidevice partition=C:
    bcdedit -set {ramdiskoptions} ramdisksdipath \BOOT\BOOT.sdi
    bcdedit -set {00000000-0000-0000-0000-000000000001} device ramdisk=[C:]\WINPE\WINPE.WIM,{ramdiskoptions}
    bcdedit -set {00000000-0000-0000-0000-000000000001} path \WINDOWS\SYSTEM32\BOOT\WINLOAD.EXE
    bcdedit -set {00000000-0000-0000-0000-000000000001} osdevice ramdisk=[C:]\WINPE\WINPE.WIM,{ramdiskoptions}
    bcdedit -set {00000000-0000-0000-0000-000000000001} systemroot \WINDOWS
    bcdedit -set {00000000-0000-0000-0000-000000000001} winpe yes
    bcdedit -set {00000000-0000-0000-0000-000000000001} detecthal yes
    bcdedit -set {00000000-0000-0000-0000-000000000001} advancedoptions no
    bcdedit -displayorder {00000000-0000-0000-0000-000000000001} -addlast

    It leaves my boot option in a bad state for one boot, but the user isn't present to do anything at that point, so fixing it on the first boot wasn't a problem.

  3. My post here might help.

    You can just put the WIM file you have in your \ISO\sources\ folder on the hard drive and use the Vista Boot Loader configured with bcdedit to boot it. I have my WIM file sitting on C: and XP on D: (but only boot.ini is involved with that). The bcdedit commands in my post show how to set it up that way. You could have both the WIM and your OS on C: as long as boot.ini is pointing at the right location for your OS.

  4. The registry error at that first boot usually means the partition that you installed the image on was not formatted before the image is installed. I've seen that a handful of times.

    I don't have any experience with setres or using winpeshl.ini, but you don't need to use MSHTA.EXE to launch an HTA file from a batch file like startnet.cmd, PE will launch it by association to the full path if you just execute the HTA file name.

  5. If you know the diskpart commands you're going to run, I suggest the following:

    Sub RunFull
    Set objShell = CreateObject("WScript.Shell")

    cmd = "%comspec% /c diskpart /s X:\windows\system32\full_diskpart.txt"
    objShell.Run cmd,0,1 ' Run the command in a hidden window and wait for a return

    cmd = "%comspec% /c imagex /apply c:\sp1.wim 1 d:\"
    objShell.Run cmd,0,1

    valAnswer = msgbox("Recovery Complete. Would you like to Restart now?",vbYesNo,"Restart now?")
    If valAnswer = vbYes Then
    cmd = "wpeutil reboot"
    objShell.Run cmd,0,1
    End If

    End Sub

  6. Whenever I boot into PE from CD or locally I run two batch files via startnet.cmd, so I'm not sure if this will help when booted from a USB disk. The first changes the CD / DVD drive that has the bootable PE CD (label "CD_ROM") to K:, the second checks for C:, D:, and E: (the only hard drive partitions I care about) to be on Disk 0 and changes them to P:, Q:, and / or R: if they're not.

    Changes the CD / DVD drive with the bootable PE CD to K:

    @echo off
    echo list volume > X:\ListCD.txt
    FOR /F "tokens=2,4" %%i IN ('diskpart /s X:\ListCD.txt') DO @IF /I %%j == CD_ROM SET CDROMVOL=%%i
    IF DEFINED CDROMVOL echo select volume %CDROMVOL% > X:\ChangeCD.txt
    IF DEFINED CDROMVOL echo assign letter=K: >> X:\ChangeCD.txt
    IF DEFINED CDROMVOL diskpart /s X:\ChangeCD.txt

    Changes C:, D:, and / or E: to P:, Q:, and / or R: if not on Disk 0

    @echo off

    echo list volume > X:\ListVol.txt
    diskpart /s X:\ListVol.txt > X:\ListVol.dat

    FOR /F "tokens=2,3" %%i IN (X:\ListVol.dat) DO @IF /I %%j==C SET CVOL=%%i
    FOR /F "tokens=2,3" %%i IN (X:\ListVol.dat) DO @IF /I %%j==D SET DVOL=%%i
    FOR /F "tokens=2,3" %%i IN (X:\ListVol.dat) DO @IF /I %%j==E SET EVOL=%%i

    goto DONE

    echo select vol %CVOL% > X:\CVOL.txt
    echo detail vol >> X:\CVOL.txt
    diskpart /s X:\CVOL.txt > X:\CVOL.dat
    FOR /F "tokens=2,3" %%i IN (X:\CVOL.dat) DO @IF /I %%j==Online SET CDISK=%%i
    FOR /F "tokens=2-4" %%i IN (X:\CVOL.dat) DO @IF /I %%j.%%k==No.Media SET CDISK=%%i
    goto DONE

    echo select vol %CVOL% > X:\CFIX.txt
    echo assign letter=P >> X:\CFIX.txt
    diskpart /s X:\CFIX.txt
    goto DONE

    echo select vol %DVOL% > X:\DVOL.txt
    echo detail vol >> X:\DVOL.txt
    diskpart /s X:\DVOL.txt > X:\DVOL.dat
    FOR /F "tokens=2,3" %%i IN (X:\DVOL.dat) DO @IF /I %%j==Online SET DDISK=%%i
    FOR /F "tokens=2-4" %%i IN (X:\DVOL.dat) DO @IF /I %%j.%%k==No.Media SET DDISK=%%i
    goto DONE

    echo select vol %DVOL% > X:\DFIX.txt
    echo assign letter=Q >> X:\DFIX.txt
    diskpart /s X:\DFIX.txt
    goto DONE

    echo select vol %EVOL% > X:\EVOL.txt
    echo detail vol >> X:\EVOL.txt
    diskpart /s X:\EVOL.txt > X:\EVOL.dat
    FOR /F "tokens=2,3" %%i IN (X:\EVOL.dat) DO @IF /I %%j==Online SET EDISK=%%i
    FOR /F "tokens=2-4" %%i IN (X:\EVOL.dat) DO @IF /I %%j.%%k==No.Media SET EDISK=%%i
    goto DONE

    echo select vol %EVOL% > X:\EFIX.txt
    echo assign letter=R >> X:\EFIX.txt
    diskpart /s X:\EFIX.txt


    If you want to use it you can mess around with the commands while in PE to see for yourself what's being parsed from the diskpart commands. In the second script, the line that can have the "Online" or "No Media" values will have "* Disk 0" at the beginning if it's on Disk 0, but no * if it's not. If it's not Disk 0, the 2nd token would be the disk #, and the third "Online" or the third and fourth "No Media". If a disk # is found, the volume number is used to change the drive letter. I mainly had to do this because built-in storage card readers were using drive letters I needed if the disk was empty.

  7. 1. Repair and Full recovery buttons do not launch their helper HTAs properly. MSHTA is executed but the HTA does not appear. Testing in VM fails script processing because the VM is running XP Pro and not WinPE.

    How are you launching these other HTAs? A shell object.run command? If so, make sure the first parameter isn't 0 or the window will be hidden (ex. objShell.Run cmd, 0, 0) Are you running them by just using the command "FILENAME.HTA" or are you using "mshta.exe FILENAME.HTA"? Are you putting a "%comspec% /c" in front of it?

    2. Command prompt authenticator box stays open after cmd.exe is launched.

    Is this a pop-up box or within the HTA's HTML? If it's in the HTML you should be able to use a div or span area and just replace its contents when you launch your cmd.exe.

    4. Need to change restart button to open a OK/Cancel msgbox instead of a standard OK box. This way if the user clicks the button by accident they won't be forced to reboot even if they cancel.

    This should be easy enough to fix with something like valAnswer = msgbox("Do you really want to reboot now?", vbYesNo,"Reboot?")...if valAnswer=vbYes...if valAnswer=vbNo

  8. Just to start with the obvious, do you have enough free space on the drive you're trying to mount the image on? Does it hit a certain percentage every time it stops? Does it even start the mount process? Does it behave the same on different PCs?

  9. Ok, I jumped to conclusions on this one and it does (sort of) make sense. Most of the workstations I was testing on were already loaded with XP and the two oldest ones had Win2K. I found that even after installing XP on the old workstations they still couldn't convert FAT32 to NTFS in WinPE, but if the other workstations were running Win2K the conversion worked. It turned out to be the hard drives in the old workstations I first tested on, so this issue does, in some manner, make sense.

  10. Here's some code for how to do it with CheckKeys and ClearKeys:

    Function CheckKeys

    Select Case Window.Event.KeyCode ' Standard ASCII keycodes
    Case 65 ' A
    boolFirstKey = True
    Case 66 ' B
    boolSecondKey = True
    Case 67 ' C
    boolThirdKey = True
    End Select

    If boolFirstKey And boolSecondKey And boolThirdKey Then
    cmd = "%comspec% /c start ""Command Prompt"" %comspec%"
    objShell.Run cmd,0,0 ' Invisible command window to run the start command, which will be visible, don't wait on return
    End If

    The bool* variables would need to be declared with Dim at the beginning of the <script LANGUAGE="VBScript"> section so that they're global since the CheckKeys function will only set one of them to true and then exit when a key is pressed. This also assumes you want to push the keys A, B, and C at the same time, since ClearKeys would reset the variables when any key was released.

    You can put whatever you want in that cmd string, like "%comspec% /c X:\WINDOWS\SYSTEM32\Notepad.exe" or something.

  11. I'm trying to automate the conversion from FAT32 to NTFS on all of our old workstations. I've decided to do this by automating a reboot into WinPE 2.1 running in RAM so that there are no files in-use, which would cause the convert.exe execution in Windows to display more than a prompt for the volume name, and thus kill my automation. The Vista Boot Loader is installed and used to boot to Windows 2000/XP or a standard WIM image. I add another entry for the special conversion WIM and configure a one-time boot with bcdedit's "-bootsequence" flag.

    Here's the baffling part: Windows XP workstations have no problem performing the conversion. When PE's convert.exe is run on a Windows 2000 workstation, it prompts for the volume name, then acts just like chkdsk doing a disk check and never converts anything! I tried running the convert.exe file included with 2000 and XP in PE but it does nothing. However, the drives can be converted no problem when in Win2K.

    Does this make any sense? Could the file allocation table used by 2K be the cause? I tried several experiments like putting XP's NTLDR and NTDETECT.COM in place, reverting the boot sector with bootsect /nt52, and all I can think of is something is up with the file allocation table. Any thoughts?

  12. The Sysprep Windows XP image I install on D:\ was installed and sealed on D:\, so I don't think you can install and seal an image on C:\ and expect it to automatically adjust to work when you apply it to D:\. I suggest you either re-create your XP image or swap your partitions around so XP is on C:\ and PE is on D:\.

  13. You could accomplish all your tasks in an HTA instead of Flash. I've configured our workstations with a bootable RAM disk PE image in the boot menu that runs an HTA via startnet.cmd. I use the cmdow.exe tool (freeware) to hide the PE command prompt and then use it to reveal it if a special key combo is pushed and password entered. If you want to leave it visible, here's a snippet that would prevent ALT+TAB unless a password has been entered at some point, and hides the system menu (prevents minimize):

    <title>HTA Test</title>

    <script LANGUAGE="VBScript">

    Dim boolPasswordEntered
    Dim boolALTkey, boolTABkey
    boolPasswordEntered = False

    Document.OnKeyDown = GetRef("CheckKeys")
    Document.OnKeyUp = GetRef("ClearKeys")

    Function Window_OnLoad
    ' Do your stuff and something to make boolPasswordEntered = True
    End Function

    Function CheckKeys

    Select Case Window.Event.KeyCode
    Case 18 ' ALT
    boolALTKey = True
    Case 9 ' ALT
    boolTABKey = True
    End Select

    If boolALTKey And boolTABKey And Not boolPasswordEntered Then
    End If

    End Function

    Function ClearKeys

    boolALTKey = False
    boolTABKey = False

    End Function

    Function DoNothing

    Window.Event.returnValue = False

    End Function




    You can then insert functions to perform your various tasks.

    You could have your password prompt always visible, but I don't display mine unless a special key combo is pushed. I like to use tables in my <body> section with <span> and <div> so I can put together a string of code anywhere in the script and then assign it to the <span> or <div> dynamically. For instance, when my key combo is pushed, I call a function to assemble a string that has password_box and submit (button) input objects and then set SPAN_ID.InnerHTML = TheString. If the correct password is entered, I unhide the command prompt and close the HTA.

    Just throwing this stuff out there since you'd need more VBScript and HTML code to add all the things you want to do, but it wouldn't be too difficult.

  14. Microsoft is not releasing an SP3 integrated CD2 and nor is it supported to manually slipstream SP3 into a SP2 CD2. There are 2 options available for deploying a Windows XP Tablet PC Edition with Service Pack 3 included:

    Option #1:

    This option maintains your current SP2 Tablet PC Edition image and just incorporates the installation of SP3 into the deployment.

    * Deploy a Windows XP Professional SP2 Image(converting to Tablet PC Edition as needed)

    * As part of the deployment update the image to SP3

    Option #2:

    1. Deploy separate Windows XP and Windows XP Tablet PC Edition SP3 images.

    I have been deploying XPSP2 by applying a standard image sealed with SysPrep and then booting into mini-setup. For XP Tablet, the factory.exe, setupcl.exe, setupmgr.exe, and sysprep.exe files are replaced with versions from the Tablet 2005 SP2 media and the appropriate tablet.txt and \i386\...\ files and folders from the Tablet CD placed in the SysPrep folder.

    I wanted to update my base image to SP3, so I restored my SP2 pre-SysPrep Ghost image, manually installed SP3, replaced the SP2 SysPrep files with the downloaded SP3 Deploy.cab files, and re-sealed the image. XP Pro would load up no problem, but XP Tablet had issues. The software keyboard at the Ctrl-Alt-Del screen would just have the window frame and nothing inside, and attempting to launch the Tablet PC Input Panel would result in a crash of tabtip.exe and it would never launch again. Come to find out, M$ has decided not to support this method of deploying Tablet with SP3 due to who knows why. I suspect to encourage more Vista.

    I did some experimenting and finally found a solution that works. If you're trying to do the same thing I am, here's what to do:

    1. Get your SysPrep files for XP Tablet (C:\Sysprep, C:\Sysprep\i386\$oem$\, C:\Sysprep\i386\cmpnents\, C:\Sysprep\i386\digitizer\, etc.)

    2. Download the XP SP3 patch file

    3. Run the command "WindowsXP-KB936929-SP3-x86-ENU.exe /extract:C:\SP3TEMP"

    4. Copy C:\SP3TEMP\i386\root\cmpnents\netfx\i386\netfx.cab to the C:\Sysprep\i386\cmpnents\netfx\i386\ folder, overwriting the existing file

    5. Copy all files from C:\SP3TEMP\i386\root\cmpnents\tabletpc\i386\ to C:\TABTEMP\

    6. Copy all files from C:\SP3TEMP\i386\root\cmpnents\tabletpc\i386\ to the C:\Sysprep\i386\cmpnents\tabletpc\i386\ folder, overwriting the existing files

    7. Use the Windows EXPAND.EXE command to expand the compressed files in C:\TABTEMP\. Sample .bat attached.

    8. Copy all files contained in C:\Sysprep\i386\cmpnents\tabletpc\i386\TABLETPC.CAB to C:\CABTEMP\

    9. Find the files in C:\TABTEMP\ that are also in C:\CABTEMP\ and copy them from C:\TABTEMP\ to C:\CABTEMP\, overwriting the existing files

    10. Download the M$ CAB SDK and issue the following command from the extracted \BIN\ folder: "cabarc n TABLETPC.CAB C:\CABTEMP\*.*"

    11. Copy the newly-created TABLETPC.CAB to C:\Sysprep\i386\cmpnents\tabletpc\i386\, overwriting the existing file

    Now all that's left is putting in place the C:\Sysprep\ folder for mini-setup. I did not replace the Sysprep *.exe files that were copied from the Tablet SP2 CD with the versions included in the SP3 Deploy.cab. Oh, and FYI, don't plan on getting any M$ support for this method.


  • Create New...