Jofnn
asked on
Batch File (or other script) to remap a disk drive
Hi All,
I'm looking to be able to remap a disk drive (typically D:) to another letter via a batch (or vbs?) script. This should either (in my mind):
- Unmap the physical drive
- Try to map the physical drive to the last available letter
OR
- Disable the physical drive so that the letter is released
- Re-Enable the physical drive on the last available letter.
I know that it can all be done via Disk Management, however, this needs to be scripted. It is also important that (where possible) the user should NOT need to restart their PC.
Any help is appreciated!!
I'm looking to be able to remap a disk drive (typically D:) to another letter via a batch (or vbs?) script. This should either (in my mind):
- Unmap the physical drive
- Try to map the physical drive to the last available letter
OR
- Disable the physical drive so that the letter is released
- Re-Enable the physical drive on the last available letter.
I know that it can all be done via Disk Management, however, this needs to be scripted. It is also important that (where possible) the user should NOT need to restart their PC.
Any help is appreciated!!
have a look at mode or set in cmd
(use e.g. set/? in cmd to see how the command is used
(use e.g. set/? in cmd to see how the command is used
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Robert,
That's exactly what I'm looking for... I've tested the theory (by re-mapping my own disk drive) and this works... I'll build a script around that and put on here in due course!
That's exactly what I'm looking for... I've tested the theory (by re-mapping my own disk drive) and this works... I'll build a script around that and put on here in due course!
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
net use * \\myComputer\D$
This command assigns default share D$ to the last available drive letter.