command-line "Changing a drive letter"


Under disk managment, you can change the drive letters for the partitions, or drives in your system.

Does anyone know how to do this at the command prompt?

I know I can assign drive letters like:
c:\> net use k: "\\myserver\hidShare$" /persistent:yes

But I'm looking for a command that will manipulate the drive letters already assigned by the Operating System. (or delete drive letters assinged to a particular partition - and (perhaps, but not necessary) mount it as a volume)

Thanks IA for any info.
rambleAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pete LongTechnical ConsultantCommented:
Hi ramble,
SUBST

Substitute a drive letter for a network or local path.


syntax
      SUBST drive_letter: path
   
      SUBST
   
      SUBST drive_letter: /D

key
   SUBST with no parameters will display current SUBST drives

   /D : Delete the drive_letter substitution.
Compared to mapping a drive with NET USE the SUBST command allows mapping to a subfolder of a drive share - for the storage of user profiles this reduces the number of shares you need to create on the server.

Bugs
Under NT 4 SUBST'ed drives cannot be disconnected using the Explorer GUI - this was fixed in Win 2K.

In Win 2k you will have problems creating, accessing and deleting drive mappings with SUBST.

However under Win 2K or XP the functionality of the NET USE command is improved so you can now do
NET USE g: \\server\share\folder1\folder2

If the network resource is unavailable (ie the server is down) SUBST will continually retry - unlike NET USE which will try to connect once and fail - depending on your application this may be a good or a bad thing - a subst drive that is not available will badly impact performance of most applications.

Notice that when SUBST is used against a local shared folder, it will create a RECYCLER for that drive. The RECYCLER is not removed when the drive substitution is removed, but can be deleted manually.

"A man should never be ashamed to own he has been in the wrong, which is saying in other words, that he is wiser today than he was yesterday" - Alexander Pope (thoughts on various subjects)

Related Commands:

NET USE - Map a drive letter to a network drive

Equivalent Linux BASH commands:

none - unix has mount points rather than silly drive letters


http://www.ss64.com/nt/subst.html

PeteL
0
rambleAuthor Commented:

yes, actually, the command that I used in my example (net use) is better than subst for many situation.

I'm actually wanting to be able to change the letter on actual partitons, or disks.  In the "Disk Manager", Notice the Disks have a Disk ID (such as disk0, disk1, disk2...etc).  I am probably looking for something that would have to refer to the disk ID and/or partition ID information.

0
wtrmk74Commented:
you will have to invest in a partition manager !

this cannot be done within a DOS coomand...
LABEL - will change the drive label
DBLSPACE - can unmount and mount but cannot be ran while windows GUI is running.

Sorry,
wtrmk74
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

rambleAuthor Commented:

This CAN be done.  (albeit a 3rd party windows script utility, or a C or CPP program).  Every command that one requests for windows to perform some kind of action is done  by a system call.  This forum is only one avenue I'm using to find out what that system call is...and how to use it.  

I might need to post this question in a programming forum, instead of an OS forum...but I thought that an Admin out there may have ran across this.  

But make no mistake, the solution exists!

0
Pete LongTechnical ConsultantCommented:
You Might want to request  PAQ Refund for this question :0)

Pete
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rambleAuthor Commented:

Good Answer!  :^)
0
Pete LongTechnical ConsultantCommented:
You are far to kind, ThanQ

Pete
0
rambleAuthor Commented:
Thanks_ramble

Just Ignore the last comment
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.