Djinsanity Posted January 4, 2013 Posted January 4, 2013 I have created a menu which will run in winpe from a USB device, to apply both imagex and Ghost images which are stored on the same device. The problem is the drive letter changes on different machines. I need to either force the usb to have a set letter or discover the drive letter and assign it to the path of the image. can anybody enlighten me on how this can be achieved? I have spent most of the day trying to find a solution.
Moderators Melba23 Posted January 4, 2013 Moderators Posted January 4, 2013 Djinsanity,Welcome to the AutoIt forum. Perhaps you could use DriveGetDrive to list the removable drives and then look in each one for a unique file or set of files - perhaps using an MD5 hash (Crypt.au3 could help here). Or you could check for the correct USB deviceID- I showed how to do that here. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
morrison0586 Posted January 4, 2013 Posted January 4, 2013 Djinsanity,Without looking at your script I can only assume that you are trying to launch a GUI you created with AutoIT, and just need your WINPE install to call your executable. If this is correct try this out http://4sysops.com/archives/create-a-bootable-windows-pe-3-0-usb-drive-with-rescue-tools-part-2/Will show you have to get startnet.cmd as part of your WINPE in the system32 folder. If you already have this then just edit the bat be as follows:wpeinitYourScript.exeAs long as your script is in the system32 folder there is no need to call f:yourscript.exeNot sure if I am barking up the right tree but it sounds like a WINPE route that would be best not autoit. If you got all that hashed out and you are just having a problem calling your wim or gho files then use the @ScriptDir&"yourimage.wim"Hope that makes sense.
AZJIO Posted January 4, 2013 Posted January 4, 2013 (edited) $a = DriveGetDrive('ALL') $m = 'W:' If FileExists($m) Then MsgBox(0, 'Message', 'Drive ' & $m & ' already exists') Exit EndIf For $i = 1 To $a[0] If FileExists($a[$i] & '\Label') Then Run('subst.exe ' & $m & ' ' & $a[$i] & '\', @SystemDir , @SW_HIDE) ExitLoop EndIf Next If $i > $a[0] Then MsgBox(0, 'Message', 'Label not found') Edited January 4, 2013 by AZJIO My other projects or all
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now