How to define a fixed letter for an external usb drive?
I would like that when connecting an external hdd, a letter is automatically assigned
[Mod edit: Replaced original subject line: “DEFINE A FIXED LETTER POR [sic] A [sic] EXTERNAL USB DRIVE !” Please don’t use all caps in the future.]
Define a fixed letter for an external USB drive Topic is solved
-
- Posts: 29
- Joined: 22 Jan 2014, 10:31
Define a fixed letter for an external USB drive
Last edited by fmildemberger on 23 Oct 2023, 06:00, edited 1 time in total.
Re: DEFINE A FIXED LETTER POR A EXTERNAL USB DRIVE ! Topic is solved
NO NEED TO YELL.
Assuming this can be accomplished in AHK, are you really using v2? You posted in the main section of the forum, which is now for v2.
Assuming this can be accomplished in AHK, are you really using v2? You posted in the main section of the forum, which is now for v2.
Re: Define a fixed letter for an external USB drive
I used to do the same thing, but realized it was pointless since every other computer would assign a different letter. Instead I now use the following 2 functions:
If you just want to assign a drive letter to your USB drive, go to Computer Management > Disk Management, click on your drive, and Assign a letter to this drive. You must do this for every computer you have access to.
Code: Select all
DriveLabel(label) {
Loop Parse, DriveGetList()
if label = DriveGetLabel(A_LoopField ":")
return A_LoopField ":"
throw Error("Drive label " label " not found.")
}
DriveIndex(index, omitLabel := ["Heritage"]) {
i := 0
Loop Parse, DriveGetList()
if A_LoopField != SubStr(A_WinDir, 1, 1)
if "Heritage" != DriveGetLabel(A_LoopField ":")
if index = ++i
return A_LoopField ":"
throw Error("Drive index not found.")
}
Run DriveIndex(1) ; This avoids the C: Drive, and will be your D: drive or E: drive or F: drive, etc.
Run DriveLabel("My USB Drive") ; Open the usb drive called "My USB Drive"
Re: Define a fixed letter for an external USB drive
@fmildemberger
Outside AHK, check a tool called USBDLM.
Outside AHK, check a tool called USBDLM.
So much universe, and so little time. GNU Sir Terry.
-
- Posts: 29
- Joined: 22 Jan 2014, 10:31
Re: DEFINE A FIXED LETTER POR A EXTERNAL USB DRIVE !
I moved your topic to the correct subforum.
Who is online
Users browsing this forum: No registered users and 172 guests