Jump to content

Help with the assign drive in the DiaskPart command


i2i8
 Share

Recommended Posts

I'm very sorry. I have to ask for help again.

I want to use lis vol to find the efi partition and assign it a drive letter if it doesn't have one.

The output is as follows:

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\windows\system32>chcp 437 

Active code page: 437

C:\windows\system32>

Microsoft DiskPart version 6.1.7601

Copyright (C) 1999-2008 Microsoft Corporation.

On computer: WIN-9KKUI6K0PT8

DISKPART> 

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info

  ----------  ---  -----------  -----  ----------  -------  ---------  --------

  Volume 0     E                       DVD-ROM         0 B  No Media           

  Volume 1     C                NTFS   Partition     39 GB  Healthy        

  Volume 2                      FAT32  Partition    100 MB  Healthy    Hidden  

  Volume 3     D                NTFS   Partition     49 GB  Healthy            

DISKPART> 

The above result is the output after I insert windows_server_2008_r2.iso and boot from CD-ROM. On the first screen of boot, press Shift + F10 and run the following script.

#RequireAdmin
Global $sRet,$aRet

Local $iPid = Run(@ComSpec & " /c (echo,chcp 437) | cmd.exe & (echo, lis vol) | diskpart.exe", "C:\windows\system32", @SW_HIDE, 0x8)
ProcessWaitClose($iPid)
$sRet = BinaryToString(StdoutRead($iPid, 1, 1), 1)
MsgBox(0, "", $sRet)

Next, how should I write this script to assign a drive letter to vol 2 ?

Edited by i2i8
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
 Share

  • Recently Browsing   0 members

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