I have 10 workstations with large monitors that have USB slots and several card readers built in. The card readers cannot be disabled and will map to drive letters when I image the computers. I go into Disk Management and delete the drive mappings and add mappings to a single folder in C: with a folder for each slot. I have to do this because of scripts that run that are expecting specific letter drive mappings to network resources.
Is there a way to script the deleting and adding of drive mappings instead of having to use the Disk Management GUI manually on each workstation? The workstations are running XP Professional.
Based on sinping’s comment to use diskpart, I was able to get a script working.
I made a batch file to create the folders to mount as follows: (
mkdir "C:Removable Devices" mkdir "C:Removable DevicesSlot1" mkdir "C:Removable DevicesSlot2" mkdir "C:Removable DevicesSlot3" mkdir "C:Removable DevicesSlot4"
I made a script file that gets run using the line:
diskpart /s c:tempchgltrs.txt
For the workstations, volume 0 is the DVD-ROM and volume 1 is C which I found by running
diskpart and typing
list volume. I found out recently that it is better to select the volume by letter because the volume order can change if something is plugged in like a USB key.
The script is a follows: (
select volume e remove assign mount="C:Removable DevicesSlot1"select volume f remove assign mount="C:Removable DevicesSlot2"select volume g remove assign mount="C:Removable DevicesSlot3"select volume h remove assign mount="C:Removable DevicesSlot4"
Take a look at the diskpart command. I haven’t used it with card readers but it should be able to do it. You can look at the setup on one machine you have configured already and just copy most of that config over to another one to import as a batch.
Leave a comment
- What is the easiest way to upgrade my existing Perl 5.14 to Perl 5.16 on FreeBSD 9 using the ports system?
- Know if mysql has done its job
- Redirect https .com to https .co.uk without a valid SSL cert on .com without DNS change
- Why is it a bad idea to use customer email as from address
- 100% packets dropped on first RX queue on 3/5 raid6 iSCSI NAS devices using intel igb (resolved)