Sign in to follow this  
Followers 0
didimons

dropdown list with existing disc drives

9 posts in this topic

Hello,

I'm trying to create an installer window that automatically detects the OS version, displays this in the window and lets the user choose the physical disc from a dropdown menu to run the installation

the detection of the windows version is no problem but I can't figure out how to create a dropdown menu that shows the physical drives.

Is it posible to use the output of drivegetdrive ("FIXED") as input for the dropdown menu ?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

didimons,

Welcome to the Autoit forum. :unsure:

What you want is very simple - use DriveGetDrive to get the available drives into an array and then convert this to a string with _ArrayToString. Finally, put the string into the combo using GUICtrlSetData: ;)

#include <Array.au3>

$aArray = DriveGetDrive("FIXED")

_ArrayDisplay($aArray) ; Just for interest

$sString = _ArrayToString($aArray, "|", 1)

MsgBox(0, "Drives", $sString) ; Just for interest

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$hCombo = GUICtrlCreateCombo("", 10, 10, 200, 20)
GUICtrlSetData(-1, $sString)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

All clear? Please ask if not. :>

M23

Edit: Typnig!

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thank you for the reply, your solution works like a charm, I have 2 further questions. First of all how can I preset the C-drive so that this is the standard suggestion? Secondly how can I use the selected drive in the rest of the installation?

I've created the script below as a test:

#include <ButtonConstants.au3>

#include <ComboConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#include <Array.au3>

$osv = @OSVersion

$ost = @OSArch

$aArray = DriveGetDrive("FIXED")

$sString = _ArrayToString($aArray, "|", 1)

$Form1 = GUICreate("Oracle Discoverer 10g R2 installer", 400, 150, 192, 124)

$Group1 = GUICtrlCreateGroup("Detected OS", 25, 16, 150, 50)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

$OSselect1 = GUICtrlCreateInput("" & @OSVersion & @OSArch, 50, 35, 100, 20)

$Group2 = GUICtrlCreateGroup("Select Destination Drive", 220, 16, 150, 50)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

$DriveSelect1 = GUICtrlCreateCombo("", 240, 35, 105, 25)

GUICtrlSetData(-1, $sString)

GUISetState(@SW_SHOW)

$Button1 = GUICtrlCreateButton("Install", 88, 80, 105, 49)

$Button2 = GUICtrlCreateButton("Quit", 200, 80, 105, 49)

While 1

$nMsg = GUIGetMsg()

Select

Case $nmsg = $GUI_EVENT_CLOSE

ExitLoop

Case $nmsg = $Button1

If $sString = "c:" Then

Run ("c:\testc.bat")

EndIf

If $DriveSelect1 = "d:" Then

Run ("d:\testd.bat")

EndIf

Case $nmsg = $Button2

MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed

EndSelect

WEnd

Share this post


Link to post
Share on other sites

didimons,

how can I preset the C-drive so that this is the standard suggestion?

A quick look at GUICtrlCreateCombo in the Help file would show you that you do it like this: :alien:

$DriveSelect1 = GUICtrlCreateCombo("", 240, 35, 105, 25)
GUICtrlSetData(-1, $sString, "c:")

how can I use the selected drive in the rest of the installation?

Use GUICtrlRead to see what has been selected in the combo - details are (you guessed it!) in the Help file. ;)

Give it a go yourself and come back if you have problems. :huh2:

M23

P.S. When you post code please use Code tags. Put [autoit] before and [/autoit] after your posted code.


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

didimons,

A quick look at GUICtrlCreateCombo in the Help file would show you that you do it like this: :alien:

$DriveSelect1 = GUICtrlCreateCombo("", 240, 35, 105, 25)
GUICtrlSetData(-1, $sString, "c:")

Use GUICtrlRead to see what has been selected in the combo - details are (you guessed it!) in the Help file. ;)

Give it a go yourself and come back if you have problems. :huh2:

M23

P.S. When you post code please use Code tags. Put [autoit] before and [/autoit] after your posted code.

Thanks for your help M23, just to show what I made with your help:

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
$osv = @OSVersion
$ost = @OSArch

$aArray = DriveGetDrive("FIXED")
    $sString = _ArrayToString($aArray, "|", 1)
$Form1 = GUICreate("Oracle Discoverer 10g R2 installer", 400, 150, 192, 124)
$Group1 = GUICtrlCreateGroup("Detected OS", 25, 16, 150, 50)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    $OSselect1 = GUICtrlCreateLabel("" & @OSVersion & @OSArch, 60, 38, 100, 20)
$Group2 = GUICtrlCreateGroup("Select Destination Drive", 220, 16, 150, 50)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    $Drive_enumeration1 = GUICtrlCreateCombo("", 240, 35, 105, 25)
    GUICtrlSetData(-1, $sString, "c:")
    GUISetState(@SW_SHOW)
$Button1 = GUICtrlCreateButton("Install", 88, 80, 105, 49)
$Button2 = GUICtrlCreateButton("Quit", 200, 80, 105, 49)
$file1 = FileOpen("X:\response\last_selected_drive.txt", 0)
    If $file1 = -1 Then
    MsgBox(0, "Error", "Unable to open x:\response\last_selected_drive.txt file.")
    Exit
    EndIf
    $last_selected_drive = FileReadLine($file1)
    FileClose($file1)
While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nmsg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $nmsg = $Button1
            $Driveselect1 = GUICtrlRead($Drive_enumeration1)  
            MsgBox(0, "Confirm", "Discoverer will be installed on " & $Driveselect1)
            MsgBox(0, "Warning", "A message will be displayed when the installer has finished, depending on your network it can take a while for the first window to appear. Please let the installer do its work!" )
            If $Driveselect1 = $last_selected_drive Then
                If $osv = "WIN_XP" Or $osv = "WIN_2003" Or $osv = "WIN2003R2" Then
                    ProgressOn ("Oracle Discoverer 10g R2 Install", "Install Progress")
                    ProgressSet(0, "Installing Discoverer 10g R2 basic")
                    RunWait ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_disco10gr2 -ignoreSysPrereqs -silent")
                    Sleep (20000)
                    WinWaitActive ("Oracle Universal Installer")
                    Send ("{ENTER}")
                    WinWaitClose("Oracle Universal Installer")
                    ProgressSet (25, "Installing Discoverer 10g R2 patch")
                    Run ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_5983622 -ignoreSysPrereqs -silent")
                    Sleep (20000)
                    WinWaitActive ("Oracle Universal Installer")
                    Send ("{ENTER}")
                    WinWaitClose("Oracle Universal Installer")
                    ProgressSet (50, "Copying Perl directory")
                    Run ("X:\response\perl_xcopy.bat")
                    Sleep (10000)
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (60, "Applying first Opatch")
                    Run ("X:\response\opatch_winXP_1.bat")
                    Sleep (10000)
                    WinWaitActive ("[CLASS:ConsoleWindowClass]")
                    Send ("y{ENTER}")
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (70, "Applying second Opatch")
                    Run ("X:\response\opatch_winXP_2.bat")
                    Sleep (10000)
                    WinWaitActive ("[CLASS:ConsoleWindowClass]")
                    Send ("y{ENTER}")
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (80, "Starting Discoverer to create default registry parameters")
                    Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51adm.exe")
                    Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51usr.exe")
                    Sleep (20000)
                    ProcessClose ("dis51adm.exe")
                    ProcessClose ("dis51usr.exe")
                    WinWaitClose ("OracleBI Discoverer Administrator")
                    WinWaitClose ("Oracle Business Intelligence Discoverer Desktop")
                    ProgressSet (90, "Importing additional registry parameters")
                    Run ("reg import X:\response\reg_user.reg")
                    If $ost = "X86" Then
                        Run ("reg import X:\response\reg_local_machine.reg")
                    EndIf
                    If $ost = "X64" Then
                        Run ("reg import X:\response\reg_local_machine_64bit.reg")
                    EndIf
                    ProgressSet (100, "Oracle Discoverer 10g R2 installation complete")
                    Sleep (10000)
                    ProgressOff()
                    MsgBox(0,"Discoverer 10g R2", "Discoverer 10g R2 has been installed")
                    Exit
                EndIf
                If $osv = "WIN_7" Or $osv = "WIN_2008" Or $osv = "WIN_2008R2" Then
                    MsgBox(0,"Warning", "When installing on Windows 7 / 2008 it is possible that you will receive Windows Security Alert concerning java.exe, Select Domain networks and click on Allow access")
                    MsgBox(0,"Warning", "During the installation it is possible that the message: The procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLL. appears several times. This may be ignored by clicking OK.")
                    ProgressOn ("Oracle Discoverer 10g R2 Install", "Install Progress")
                    ProgressSet(0, "Installing Discoverer 10g R2 basic")
                    RunWait ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_disco10gr2_win7 -ignoreSysPrereqs -silent", "", @SW_HIDE)
                    Sleep (20000)
                    WinWaitActive ("Oracle Universal Installer")
                    Send ("{ENTER}")
                    WinWaitClose("Oracle Universal Installer")
                    ProgressSet (25, "Installing Discoverer 10g R2 patch")
                    Run ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_5983622_win7 -ignoreSysPrereqs -silent", "", @SW_HIDE)
                    Sleep (20000)
                    WinWaitActive ("Oracle Universal Installer")
                    Send ("{ENTER}")
                    WinWaitClose("Oracle Universal Installer")
                    ProgressSet (50, "Copying Perl directory")
                    Run ("X:\response\perl_xcopy.bat", "", @SW_HIDE)
                    Sleep (10000)
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (60, "Applying first Opatch")
                    Run ("X:\response\opatch_win7_1.bat")
                    Sleep (10000)
                    WinWaitActive ("[CLASS:ConsoleWindowClass]")
                    Send ("y{ENTER}")
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (70, "Applying second Opatch")
                    Run ("X:\response\opatch_win7_2.bat")
                    Sleep (10000)
                    WinWaitActive ("[CLASS:ConsoleWindowClass]")
                    Send ("y{ENTER}")
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (80, "Starting Discoverer to create default registry parameters")
                    Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51adm.exe", "", @SW_HIDE)
                    Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51usr.exe", "", @SW_HIDE)
                    Sleep (20000)
                    ProcessClose ("dis51adm.exe")
                    ProcessClose ("dis51usr.exe")
                    WinWaitClose ("OracleBI Discoverer Administrator")
                    WinWaitClose ("Oracle Business Intelligence Discoverer Desktop")
                    ProgressSet (90, "Importing additional registry parameters")
                    Run ("reg import X:\response\reg_user.reg", "", @SW_HIDE)
                    If $ost = "X86" Then
                        Run ("reg import X:\response\reg_local_machine.reg", "", @SW_HIDE)
                    EndIf
                    If $ost = "X64" Then
                        Run ("reg import X:\response\reg_local_machine_64bit.reg", "", @SW_HIDE)
                    EndIf
                    ProgressSet (100, "Oracle Discoverer 10g R2 installation complete")
                    Sleep (10000)
                    ProgressOff()
                    MsgBox(0,"Discoverer 10g R2", "Discoverer 10g R2 has been installed")
                    Exit
                EndIf
            Else
                $file2 = "X:\response\last_selected_drive.txt"
                $file3 = "X:\response\install_5983622"
                $file4 = "X:\response\install_5983622_win7"
                $file5 = "X:\response\install_disco10gr2"
                $file6 = "X:\response\install_disco10gr2_win7"
                $file7 = "X:\response\opatch_win7_1.bat"
                $file8 = "X:\response\opatch_win7_2.bat"
                $file9 = "X:\response\perl_xcopy.bat"
                $file10 = "X:\response\opatch_winXP_1.bat"
                $file11 = "X:\response\opatch_winXP_1.bat"
                $old_value = (& $last_selected_drive"\")
                $new_value = (& $Driveselect1"\")
                _ReplaceStringInFile ($file2,$last_selected_drive,$Driveselect1)
                _ReplaceStringInFile ($file3,$old_value,$new_value)
                _ReplaceStringInFile ($file4,$old_value,$new_value)
                _ReplaceStringInFile ($file5,$old_value,$new_value)
                _ReplaceStringInFile ($file6,$old_value,$new_value)
                _ReplaceStringInFile ($file7,$old_value,$new_value)
                _ReplaceStringInFile ($file8,$old_value,$new_value)
                _ReplaceStringInFile ($file9,$old_value,$new_value)
                _ReplaceStringInFile ($file10,$old_value,$new_value)
                _ReplaceStringInFile ($file11,$old_value,$new_value)
                If $osv = "WIN_XP" Or $osv = "WIN_2003" Or $osv = "WIN2003R2" Then
                    ProgressOn ("Oracle Discoverer 10g R2 Install", "Install Progress")
                    ProgressSet(0, "Installing Discoverer 10g R2 basic")
                    RunWait ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_disco10gr2 -ignoreSysPrereqs -silent")
                    Sleep (20000)
                    WinWaitActive ("Oracle Universal Installer")
                    Send ("{ENTER}")
                    WinWaitClose("Oracle Universal Installer")
                    ProgressSet (25, "Installing Discoverer 10g R2 patch")
                    Run ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_5983622 -ignoreSysPrereqs -silent")
                    Sleep (20000)
                    WinWaitActive ("Oracle Universal Installer")
                    Send ("{ENTER}")
                    WinWaitClose("Oracle Universal Installer")
                    ProgressSet (50, "Copying Perl directory")
                    Run ("X:\response\perl_xcopy.bat")
                    Sleep (10000)
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (60, "Applying first Opatch")
                    Run ("X:\response\opatch_winXP_1.bat")
                    Sleep (10000)
                    WinWaitActive ("[CLASS:ConsoleWindowClass]")
                    Send ("y{ENTER}")
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (70, "Applying second Opatch")
                    Run ("X:\response\opatch_winXP_2.bat")
                    Sleep (10000)
                    WinWaitActive ("[CLASS:ConsoleWindowClass]")
                    Send ("y{ENTER}")
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (80, "Starting Discoverer to create default registry parameters")
                    Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51adm.exe")
                    Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51usr.exe")
                    Sleep (20000)
                    ProcessClose ("dis51adm.exe")
                    ProcessClose ("dis51usr.exe")
                    WinWaitClose ("OracleBI Discoverer Administrator")
                    WinWaitClose ("Oracle Business Intelligence Discoverer Desktop")
                    ProgressSet (90, "Importing additional registry parameters")
                    Run ("reg import X:\response\reg_user.reg")
                    If $ost = "X86" Then
                        Run ("reg import X:\response\reg_local_machine.reg")
                    EndIf
                    If $ost = "X64" Then
                        Run ("reg import X:\response\reg_local_machine_64bit.reg")
                    EndIf
                    ProgressSet (100, "Oracle Discoverer 10g R2 installation complete")
                    Sleep (10000)
                    ProgressOff()
                    MsgBox(0,"Discoverer 10g R2", "Discoverer 10g R2 has been installed")
                    Exit
                EndIf
                If $osv = "WIN_7" Or $osv = "WIN_2008" Or $osv = "WIN_2008R2" Then
                    MsgBox(0,"Warning", "When installing on Windows 7 / 2008 it is possible that you will receive Windows Security Alert concerning java.exe, Select Domain networks and click on Allow access")
                    MsgBox(0,"Warning", "During the installation it is possible that the message: The procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLL. appears several times. This may be ignored by clicking OK.")
                    ProgressOn ("Oracle Discoverer 10g R2 Install", "Install Progress")
                    ProgressSet(0, "Installing Discoverer 10g R2 basic")
                    RunWait ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_disco10gr2_win7 -ignoreSysPrereqs -silent", "", @SW_HIDE)
                    Sleep (20000)
                    WinWaitActive ("Oracle Universal Installer")
                    Send ("{ENTER}")
                    WinWaitClose("Oracle Universal Installer")
                    ProgressSet (25, "Installing Discoverer 10g R2 patch")
                    Run ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_5983622_win7 -ignoreSysPrereqs -silent", "", @SW_HIDE)
                    Sleep (20000)
                    WinWaitActive ("Oracle Universal Installer")
                    Send ("{ENTER}")
                    WinWaitClose("Oracle Universal Installer")
                    ProgressSet (50, "Copying Perl directory")
                    Run ("X:\response\perl_xcopy.bat", "", @SW_HIDE)
                    Sleep (10000)
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (60, "Applying first Opatch")
                    Run ("X:\response\opatch_win7_1.bat")
                    Sleep (10000)
                    WinWaitActive ("[CLASS:ConsoleWindowClass]")
                    Send ("y{ENTER}")
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (70, "Applying second Opatch")
                    Run ("X:\response\opatch_win7_2.bat")
                    Sleep (10000)
                    WinWaitActive ("[CLASS:ConsoleWindowClass]")
                    Send ("y{ENTER}")
                    WinWaitClose ("[CLASS:ConsoleWindowClass]")
                    ProgressSet (80, "Starting Discoverer to create default registry parameters")
                    Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51adm.exe", "", @SW_HIDE)
                    Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51usr.exe", "", @SW_HIDE)
                    Sleep (20000)
                    ProcessClose ("dis51adm.exe")
                    ProcessClose ("dis51usr.exe")
                    WinWaitClose ("OracleBI Discoverer Administrator")
                    WinWaitClose ("Oracle Business Intelligence Discoverer Desktop")
                    ProgressSet (90, "Importing additional registry parameters")
                    Run ("reg import X:\response\reg_user.reg", "", @SW_HIDE)
                    If $ost = "X86" Then
                        Run ("reg import X:\response\reg_local_machine.reg", "", @SW_HIDE)
                    EndIf
                    If $ost = "X64" Then
                        Run ("reg import X:\response\reg_local_machine_64bit.reg", "", @SW_HIDE)
                    EndIf
                    ProgressSet (100, "Oracle Discoverer 10g R2 installation complete")
                    Sleep (10000)
                    ProgressOff()
                    MsgBox(0,"Discoverer 10g R2", "Discoverer 10g R2 has been installed")
                    Exit
                EndIf
            EndIf
        Case $nmsg = $Button2
            ExitLoop
    EndSelect
WEnd

Share this post


Link to post
Share on other sites

Hi, this example has really helped me also which I thank you for. My question is how can I use this to display the Disk number rather than a drive letter. for example if I have 3 hard drives connected to my computer how can I make the list display...

disk=0

disk=1

disk=2

I would like to use this in conjunction with mbrwiz if that helps.

thanks

Share this post


Link to post
Share on other sites

am632,

PsaltyDS shows you how to link drive letters and drive numbers here. :huh2:

Search is a wonderful tool - you should try it some time! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi, thanks for your reply. I've had a good look at the link you sent but honestly I really dont understand it. I have been looking at this post tho which I kinda get to a point but I dont know how to modify it to list in a combo box. what I have so far is this...

$File = FileOpen(@TempDir & '\lstdsk.ini', 2)
FileWrite($File, 'list disk')
FileClose($File)
RunWait('cmd /c diskpart /s lstdsk.ini > lstdsk.txt', @TempDir, @SW_HIDE)

    Local $Text, $Line, $Array = _StringExplode(FileRead(@TempDir & '\lstdsk.txt'), @LF)
    For $i = 0 To UBound($Array) - 1
        If StringRegExp($Array[$i], '(?i)Disk [\d]+') Then $Line &= $Array[$i] & '|'
    Next
    $Line = StringRegExpReplace($Line, '[\s|]*$', '')

$DRIVE_SELECT_COMBO = GUICtrlCreateCombo($Line, 64, 140, 249, 25)

The Hard Disks appear in the combobox but all on 1 line and not as seperate items in the list.

I really dont know if im on the right track or not 2 be honest as i've not really done anything like this before. I've searched around but i'm still stumped.

thanks for reading

Share this post


Link to post
Share on other sites

am632,

Do you want drive numbers, partition numbers or drive letters? These are all intertwined as shown by the results from the code I linked you to. This is what I get:

DiskDrive = \\.\PHYSICALDRIVE0  Caption = WDC WD5000AAKS-75TMA0 ATA Device
    Partition = Disk #0, Partition #0
    Partition = Disk #0, Partition #1
        LogicalDisk = D:
    Partition = Disk #0, Partition #2
        LogicalDisk = C:
    Partition = Disk #0, Partition #3
        LogicalDisk = M:
        LogicalDisk = N:
DiskDrive = \\.\PHYSICALDRIVE1  Caption = TEAC USB   HS-CF Card USB Device
DiskDrive = \\.\PHYSICALDRIVE3  Caption = TEAC USB   HS-MS Card USB Device
DiskDrive = \\.\PHYSICALDRIVE4  Caption = TEAC USB   HS-SD Card USB Device
DiskDrive = \\.\PHYSICALDRIVE2  Caption = TEAC USB   HS-xD/SM USB Device
DiskDrive = \\.\PHYSICALDRIVE5  Caption = WDC WD80 0BB-00JHA0 USB Device
    Partition = Disk #5, Partition #0
        LogicalDisk = L:

which translates to for the real hard drives:

Physical Disk     Partition     Logical Disk
0                 0             -
0                 1             D
0                 2             C
0                 3             M
0                 3             N
5                 0             L

No matter which values you need for mbrwiz, you should be able to get them from the output that PsaltyDS's code provides - just look at how the ConsoleWrites are structured to work out which return you need. :huh2:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0