Jump to content

WinNTSetup v5.3.4


JFX

Recommended Posts

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..

Link to comment
Share on other sites


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.

Link to comment
Share on other sites

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 by devdevadev
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by devdevadev
Link to comment
Share on other sites

@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 by jaclaz
Link to comment
Share on other sites

Oh, I see how this is going to end. :ph34r:

Well devdevadev, better stick on the reboot forum.
They have much better batch file skills than I have. 

Link to comment
Share on other sites

2 hours ago, JFX said:

Oh, I see how this is going to end. :ph34r:

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
 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by jaclaz
Link to comment
Share on other sites

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


 

Link to comment
Share on other sites

  • 3 weeks later...

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 by Atari800XL
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...