How to mount drive or folder in empty NTFS folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

How to mount drive or folder in empty NTFS folder

#1 Post by alan_b » 29 Mar 2012 06:10

I can use BAT scripts to create (and cancel) folder junctions etc with access to other drives / partitions that have a Drive Letter.

How can I do something similar if the drive has no Letter ?

I suspect that DiskPart might provide one solution,
but /? gives little guidance and I fear that launching DiskPart might be like jumping into a racing car without knowing how to use the brakes :roll:

Regards
Alan

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: How to mount drive or folder in empty NTFS folder

#2 Post by foxidrive » 29 Mar 2012 07:47

Mountvol?

aGerman
Expert
Posts: 4740
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How to mount drive or folder in empty NTFS folder

#3 Post by aGerman » 29 Mar 2012 10:52

To be honest I don't understand what exactly you're looking for :?
Something like SUBST or FSUTIL HARDLINK CREATE :?:

Regards
aGerman

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: How to mount drive or folder in empty NTFS folder

#4 Post by alan_b » 29 Mar 2012 11:34

@Foxidrive
Thanks
I think I can use that.

Will it punish me if I make a mistake, or will it just give an error message ?
e.g.
MOUNTVOL C:\Extra\Data \\?\Volume{2F6DEEDC-13C1-41A9-A83A-023AEEDE7750}\My Music\
or
MOUNTVOL C:\Extra\Data\ \\?\Volume{2F6DEEDC-13C1-41A9-A83A-023AEEDE7750}\My Music\

Am I allowed to target the folder "My Music", or do I have to mount at the root ?
Would I need quotes around "My Music" ?

If there was no "C:\Extra\Data\" :-
would it be helpful and create that and then Mount the volume ?
Or will it simply give an obscure error message ?
Or will something bad happen

@aGerman
I have used SUBST to pretend a folder on partition E:\ is Drive X:\
BUT if there is no letter allocated to E:\ I do not see how SUBST will work unless it can use
\\?\Volume{2F6DEEDC-13C1-41A9-A83A-023AEEDE7750}

I know even less about FSUTIL, but am willing to learn

Incidentally. I would be interested in exploring any other possibilities that give access to a partition without a letter.

Regards
Alan

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: How to mount drive or folder in empty NTFS folder

#5 Post by foxidrive » 29 Mar 2012 12:16

alan_b wrote:Will it punish me if I make a mistake, or will it just give an error message ?
e.g.
MOUNTVOL C:\Extra\Data \\?\Volume{2F6DEEDC-13C1-41A9-A83A-023AEEDE7750}\My Music\
or
MOUNTVOL C:\Extra\Data\ \\?\Volume{2F6DEEDC-13C1-41A9-A83A-023AEEDE7750}\My Music\

Am I allowed to target the folder "My Music", or do I have to mount at the root ?
Would I need quotes around "My Music" ?


I don't know the answers. I suspect quotes might be needed.
Creating the folder before hand is needed in the GUI in XP so it might be needed in mountvol too.

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: How to mount drive or folder in empty NTFS folder

#6 Post by alan_b » 29 Mar 2012 13:36

Thanks

Regards
Alan

trebor68
Posts: 146
Joined: 01 Jul 2011 08:47

Re: How to mount drive or folder in empty NTFS folder

#7 Post by trebor68 » 31 Mar 2012 11:15

The correct command is:
MOUNTVOL path VolumeName

MOUNTVOL C:\Extra\Data\ \\?\Volume{2F6DEEDC-13C1-41A9-A83A-023AEEDE7750}\

The path "C:\Extra\Data\" will not create with this command. The folder must be create before you use MOUNTVOL.
The VolumeName is valid only for one computer. The same USB drive on another computer has a different VolumeName.

The access to the folder "My Music" is now: "C:\Extra\Data\My Music\"

Example for a command: DIR "C:\Extra\Data\My Music\"

Post Reply