Am I just a dreamer, or does something like this exist?

  • 3
    Mounting to a folder is going to be the closest thing. – surfasb Nov 15 '11 at 0:44
  • One problem is that the : charachter is also used to separate the filename and the Alternate Data Stream name. MyDrive:Foo names the Foo stream in the MyDrive file, not the Foo file in the Current Working Directory of the MyDrive disk. Also, why do you want to do this? – MSalters Nov 15 '11 at 9:43
  • I figured that it may be easier with static shortcuts and such. For example, if I have a link to E:\etc, it is only useful if E: is still the same volume. I suppose a better solution would be to mount the volume to Z: or other never-used letters. – iglvzx Nov 16 '11 at 17:05

No, you cannot. It is called a drive letter for a reason.

The command myDrive: gives the error

'myDrive:' is not recognized as an internal or external command, operable program or batch file.

Note that is does not have to be a letter in the traditional sense. You can call your drive [:, for example.

DOS allowed you to use all ASCII characters between A and ` (both inclusive), giving you a total of 32 different drive letters. I am not sure how to access the last 6 on Windows though.

The closest you can get to your "dream" is mounting. For example, you can mount a drive (a partition, actually) in the folder C:\myDrive.

Another "solution" that will work for the Windows Explorer is adding an expandable string value to the registry key

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders.

This is where the actual locations of Desktop, My Music and such are stored.

| improve this answer | |
  • 4
    A drive letter does have to be A-Z, you cannot have a non alpha character. As you said "It is called a drive letter for a reason" – Dustin G. Nov 15 '11 at 0:29
  • 1
    @DustinG.: I do not know about recent versions of Windows, but those that still had a config.sys can have drive letter that are not letters. All you need is 2 optical drives and specifying Z as the first drive letter for them. This is how I wound up with [: a couple of times... – Dennis Nov 15 '11 at 0:39
  • 1
    @DustinG: Technically, DefineDosDevice() in Windows NT accepts anything in the 0x1..0xFF range. In practice, though, very few programs accept "/:" or "[:". (You can even define foo: that way, but it just won't work.) – user1686 Nov 15 '11 at 0:43
  • @Dennis that seems to be a fluke with 3.1 or 9x, I would like to test that but there is no facility for directly or indirectly (as you propose) to give a drive a non alpha assignment on NT systems. – Dustin G. Nov 15 '11 at 0:49
  • 2
    @DustinG.: I googled it and the 32 drive letters seem to be a special case of Windows 95, 98 and (possibly) Me. However, there is still a method that will work on Windows 7: Try subst [: C:\ . Now you have drive letter [. – Dennis Nov 15 '11 at 0:56

You can create custom named "drives" using the PowerShell provider system. You would do something like

PS> New-PSDrive -name myDrive -PSProvider FileSystem -Root "F:"

You would then access the files/directories under that same drive like

PS> dir myDrive:\whatever\foo

It wasn't clear from your question if you were in a scripted/console environment or if you wanted to see this in Windows Explorer specifically. Also, I assume you were talking about a filesystem "volume". The PowerShell provider system also supports other kinds of providers.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.