Drive name instead of letter

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Pareidol
Posts: 20
Joined: 23 Mar 2016, 05:50

Drive name instead of letter

15 Dec 2023, 10:54

I want to do a filemove from an usb stick to my PC. Is it possible to use the drive name instead of the letter?
Can't find any hint to that in the manual.

Image

example:

Code: Select all

FileMoveDir, [SanDisk]:\My Folder, C:\My Folder
GEV
Posts: 1005
Joined: 25 Feb 2014, 00:50

Re: Drive name instead of letter

15 Dec 2023, 11:50

You can try

Code: Select all

DriveGet, list, list
Loop, parse, list 
{ 
    DriveGet, DriveName, Label, %A_LoopField%:
    If (DriveName = "SanDisk")
    {
        FileMoveDir, %A_LoopField%:\My Folder, C:\My Folder
            break
    }
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: balawi28, Chunjee, moltenchees and 260 guests