devdevadev Posted July 27, 2017 Posted July 27, 2017 Hi...JFX I want to run a 'WinNTSetup' script within from WinPE10 which will install 'Win 7' to %SYSPART% partition and 'Win 10' to %SYSPART1% one after another without booting to WinPE again. I mean I want to autorun 'AutoDualBoot.cmd' so that it will make complete Dual Boot of 'Windows 7' and 'Windows 10' without any furthe user action !!! Is it possible using WinNTSetup command line ? Does 'WinNTSetup' support installing two OSes in two different partitions of a Disk one after another without booting to WinPE again ? Can I make automatic Dual Boot of 'Win 7' and 'Win 10' using 'WinNTSetup' based batch file ? Regards..
JFX Posted July 29, 2017 Author Posted July 29, 2017 On 27.7.2017 at 10:41 PM, devdevadev said: Is it possible using WinNTSetup command line ? Yes. On 27.7.2017 at 10:41 PM, devdevadev said: Does 'WinNTSetup' support installing two OSes in two different partitions of a Disk one after another without booting to WinPE again ? Yes. On 27.7.2017 at 10:41 PM, devdevadev said: Can I make automatic Dual Boot of 'Win 7' and 'Win 10' using 'WinNTSetup' based batch file ? Only, if you use the same syspart and install the newest system last.
devdevadev Posted July 29, 2017 Posted July 29, 2017 (edited) Should I use following code in order to make automatic Dual boot of Win 7 and Win 10 ? :DualBoot_Win_7_10 set XML=%PTN2%\_ISO\WINDOWS\INSTALLS\CONFIGS\SMART_CHOCO.xml if exist %SYSPART% format %SYSPART% /Q /Y /V:"Windows 7" %WinNTSetup% NT6 -source:%PTN2%\sources\install.esd -WimIndex:2 -syspart:%SYSPART% -tempdrive:%SYSPART% -unattend:"%XML%"-ForceUnsigned -drivers:"%PTN2%\driver_Win7x86" -Sysletter:C -RunAfter:"set_7_usb_boot.cmd C:\windows" -OEM:%PTN2%\sources -setup -reboot if exist %SYSPART1% format %SYSPART1% /Q /Y /V:"Windows 10" %WinNTSetup% NT6 -source:%PTN2%\sources\install.esd -WimIndex:6 -syspart:%SYSPART% -tempdrive:%SYSPART1% -unattend:"%XML%"-Sysletter:C -OEM:%PTN2%\sources -setup -reboot goto :EOF I think after restart 'Win 10' will continue remaining installation phases till preparing the desktop. After reaching at the desktop of 'Win 10', I will have to auto boot to 'Win 7' entry in order to complete remaining installation phases of 'Win 7'. So how I can set to auto boot to a particular BCD *(Win 7) entry after auto-restart of 'Win 10' ? Is there any command line way to auto boot to a BCD entry after restart ? bcdedit /default {Windows 7 identifier} OR May be after reaching at the desktop of 'Win 10', I should set 'Win 7' boot entry as default OS using command line and then just restart to auto continue remaining installation phases of 'Win 7' ?Suppose I have Dual boot of 'Win 7' and 'Win 10'. And I am booted to 'Win 10' desktop. So how can I automatically get 'Windows 7 identifier' using command line ? So that I can make 'Windows 7' as default OS. And then just restart to continue remaining installation phases of 'Win 7'...?? How 'WinNTSetup' automatically detect 'syspart' drive if exist and assign BootDest=Z: (while in Disk Mgmt there is no drive letter set for 'System Reserved'partition ?). I also want to set BootDest=Z: if 'System Reserved' partition exist otherwise I will use BootDest=%OSPart1% How 'Search...' button dialog box is different from normal File Explorer ? How WinNTSetup can see 'System Reserved' partition as Z: while normal File Explorer and Disk Mgmt have not assigned any drive letter to 'System Reserved' partition ? What is secret trick you have used here ? Please help me to understood this concept ... Edited July 30, 2017 by devdevadev
JFX Posted July 31, 2017 Author Posted July 31, 2017 You should use 1 syspart for both installations! And yes at some point you need to change the boot order with bcdedit.exe, to boot the second OS and continue it's setup. This will require basic batch file skills. There is not secret in how WinNTSetup detects the syspart drive. for MBR disk scheme there is only 1 active primary partion for EFI there is only 1 partition which have the PARTITION_SYSTEM_GUID guid. However it assigns the Z:\ as a dosdevice, so disk management or unelevated explorer will not show it. 1
devdevadev Posted August 7, 2017 Posted August 7, 2017 (edited) Thanks JFX for providing your precious time... t's looking WinPE already assign drive letter to Boot Partition (System Reserved). So how I can automatically detect and get Drive Letter of 'Boot Partition' (System Reserved) using cmd in exactly the same way WinNTSetup do ? Please help me to automatically get Drive Letter of 'Boot Partition' (System Reserved) using cmd with WinNTSetup approach if possible... Thanks & Regards... Edited August 7, 2017 by devdevadev
JFX Posted August 7, 2017 Author Posted August 7, 2017 What do you want with the drive letter, if you don't know it let WinNTSetup decide.
jaclaz Posted August 7, 2017 Posted August 7, 2017 (edited) @JFX Only to keep things as together as possible and to give you some context to the otherwise seemingly unconnected question above, devdevadev has a particular ability in flip-flopping here and there without giving any hint about what he is after (the general idea). He is trying to put together a batch capable of automating the backup of some systems (that of course needs to be smart, automated and foolproof), the thread is here: http://reboot.pro/topic/21566-please-help-me-to-go-ahead/ the relevant part starts around here: http://reboot.pro/topic/21566-please-help-me-to-go-ahead/?p=204324 but starting reading from here will be enough: http://reboot.pro/topic/21566-please-help-me-to-go-ahead/?p=204348 (only a few posts) jaclaz Edited August 7, 2017 by jaclaz
JFX Posted August 7, 2017 Author Posted August 7, 2017 Oh, I see how this is going to end. Well devdevadev, better stick on the reboot forum. They have much better batch file skills than I have.
jaclaz Posted August 7, 2017 Posted August 7, 2017 2 hours ago, JFX said: Oh, I see how this is going to end. Well devdevadev, better stick on the reboot forum. They have much better batch file skills than I have. However, could you expand a little bit on?: "However it assigns the Z:\ as a dosdevice, so disk management or unelevated explorer will not show it." jaclaz
JFX Posted August 7, 2017 Author Posted August 7, 2017 Disk management/diskpart uses SetVolumeMountPoint() API. I use just like imdisk, DefineDosDevice() API. Let's say it's like the subst.exe command. There were problems with the diskmgnt way back in the old XPPE days.
jaclaz Posted August 7, 2017 Posted August 7, 2017 (edited) 6 hours ago, JFX said: Disk management/diskpart uses SetVolumeMountPoint() API. I use just like imdisk, DefineDosDevice() API. Let's say it's like the subst.exe command. There were problems with the diskmgnt way back in the old XPPE days. I see , thanks. More or less we need to find someone willing to compile a somewhat modified SDK DLEDIT: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364014(v=vs.85).aspx https://github.com/pauldotknopf/WindowsSDK7-Samples/tree/master/winbase/io/dledit jaclaz Edited August 7, 2017 by jaclaz
JFX Posted August 7, 2017 Author Posted August 7, 2017 1 hour ago, jaclaz said: More or less we need to find someone willing to compile a somewhat modified SDK DLEDIT: dledit.7z 2
jaclaz Posted August 8, 2017 Posted August 8, 2017 Thanks! C:\>DLEdit.exe Adds, removes, queries drive letter assignments usage: DLEdit.exe <Drive Letter> <NT device name> add a drive letter DLEdit.exe -t <Drive Letter> <NT device name> add a temporary drive letter DLEdit.exe -r <Drive Letter> remove a drive letter DLEdit.exe <Drive Letter> show mapping for drive letter DLEdit.exe -a show all mappings example: DLEdit.exe e:\ \Device\CdRom0 DLEdit.exe -r e:\ C:\>DLEdit.exe -a Drive Device ----- ------ C: \Device\HarddiskVolume1 D: \Device\HarddiskVolume2 E: \Device\Harddisk2\DP(1)0-0+8 F: \Device\CdRom1 G: \Device\Harddisk3\DP(1)0-0+9 H: \Device\Harddisk4\DP(1)0-0+a I: \Device\CdRom0 J: \Device\Harddisk5\DP(1)0-0+b C:\>DLEdit.exe -r F: C:\>DLEdit.exe -a Drive Device ----- ------ C: \Device\HarddiskVolume1 D: \Device\HarddiskVolume2 E: \Device\Harddisk2\DP(1)0-0+8 G: \Device\Harddisk3\DP(1)0-0+9 H: \Device\Harddisk4\DP(1)0-0+a I: \Device\CdRom0 J: \Device\Harddisk5\DP(1)0-0+b C:\>DLEdit.exe -t F: \Device\CdRom1 C:\>DLEdit.exe -a Drive Device ----- ------ C: \Device\HarddiskVolume1 D: \Device\HarddiskVolume2 E: \Device\Harddisk2\DP(1)0-0+8 F: \Device\CdRom1 G: \Device\Harddisk3\DP(1)0-0+9 H: \Device\Harddisk4\DP(1)0-0+a I: \Device\CdRom0 J: \Device\Harddisk5\DP(1)0-0+b It needs to be used together with a tool capable of listing devices without a drive letter assignment, such as dd for wndows (with --list option). @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET FLAG= FOR /F "tokens=* delims=" %%A IN ('dd.exe --list 2^>^&1') DO ( IF NOT DEFINED FLAG CALL :parsedevices %%A ) GOTO :EOF :parsedevices SET Line=%* SET PartLine=%Line:~0,7% IF "%Partline%"=="NT Bloc" SET FLAG=1&&GOTO :EOF IF "%Partline%"=="link to" SET Device=%Line:~11,50% IF "%Partline%"=="Mounted" SET Mount=%Line:~-2,2% &&ECHO !Mount!!Device! IF "%Partline%"=="Not mou" SET Mount=NO DL &&ECHO !Mount!!Device! GOTO :EOF jaclaz 1
Atari800XL Posted August 25, 2017 Posted August 25, 2017 (edited) JFX, with all the nice new releases lately, I wonder if I can ask you something: - What would be the best way to name/ rename the computer after apply/ before reset? I know it can be done with autounattend.xml, but it would be great if WinNTSetup could name the PC on its own. At this moment, I'm using this in "PostInstall" to rename the PC, but doing it in WinNTSetup would shave off one reset in some cases. WMIC ComputerSystem where Name="currentname" call Rename Name=newname WMIC isn't normally available in PE, is it? Do you know of any other way to do it in PE (maybe using WinNTSetup -runafter, or maybe a new option?) Thanks for any info... Edited August 25, 2017 by Atari800XL
jaclaz Posted August 26, 2017 Posted August 26, 2017 Computer name is (or should be) in 4 keys (on the running system): HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV Hostname HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName\ComputerName Most probably you can change them while in the PE using the Offline Registry library (and tool). http://reboot.pro/topic/11212-offline-registry-library/ http://reboot.pro/topic/11312-offline-registry/ If you are doing it manually or with other tolls/methods, make sure to get the right "ControlSet". jaclaz
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now