Assign same drive letter for usb in different computers

Discuss hardware related to portable usage, including the kind of storage devices people use, and how they use them.
Message
Author
User avatar
degaa
Posts: 6
Joined: Sat Oct 27, 2007 7:56 am
Location: Brazil

Assign same drive letter for usb in different computers

#1 Post by degaa »

I use Rocket Dock in my pendrive and would like to use it in different computers, the problem is that in each computer windows assign a different drive letter acordding to it's hardware.
I would like to have the same letter assigned to the pendrive plugging it to different computers. Is it possible to do this? Anyone have a suggestion or can help me?

User avatar
lococobra
Posts: 127
Joined: Fri Aug 03, 2007 10:42 am
Location: USA
Contact:

#2 Post by lococobra »

If you use on the fly encryption such as TrueCrypt, you can have it assign the same drive letter each time. This of course assumes that the drive letter isn't already taken...

As for other methods, autorun.. etc. No, there is no way to set your drive up to automatically request a specific drive letter. Although you could write a script that would reassign the drive letter...

User avatar
Andrew Lee
Posts: 3048
Joined: Sat Feb 04, 2006 9:19 am
Contact:

#3 Post by Andrew Lee »

Two possibilities:

1. Use "subst". eg. if physical drive letter assigned is F:, but you like V:, you can use "subst v: f:".

2. This requires you to have admin access to all the machines. You can reassign the drive letter of the USB drive using Window's Disk Management tool on all the machines, then make sure you plug it into the same USB port every time. Might not be practical in some cases.

User avatar
degaa
Posts: 6
Joined: Sat Oct 27, 2007 7:56 am
Location: Brazil

#4 Post by degaa »

Lococobra,
Do you know how to write a script? I really don't know anything about scripts. Where can I find some help or something already done and working.

User avatar
lococobra
Posts: 127
Joined: Fri Aug 03, 2007 10:42 am
Location: USA
Contact:

#5 Post by lococobra »

Yeah, I figured out how to do that a while ago and wrote a script to do something similar... but I think I lost the script.

Either way, I'm sure it required admin privileges to run, why not just go with Andrew's suggestion?

Yucca
Posts: 88
Joined: Sun May 07, 2006 10:59 am

#6 Post by Yucca »

Andrew Lee wrote:Use "subst". eg. if physical drive letter assigned is F:, but you like V:, you can use "subst v: f:".
If you want to automate Andrew's approach somewhat, you can create a small batch file as follows.

1. With Notepad (or other plaintext editor), create a file called USBon.cmd.
2. Type the following two lines in that file (replacing v: with whatever drive you want to assign to your USB drive) and save the file:

@echo off
subst v: %cd%

3. Place USBon.cmd in the root directory of your USB key drive.


Anytime you plug your USB key drive into a computer, just go to the root of the USB drive (whatever letter it is assigned) and double-click (execute) on USBon.cmd. That will create a working directory for your USB drive with the drive letter you chose in the script above. (Note that the drive letter assigned to the USB drive by the computer when you plugged it in will also still be visible. That's not a problem, just the way Windows works.)

When you unplug your USB key drive, the new drive letter will be inaccessible.

If you are fastidious and want to formally remove the substituted drive letter (instead of just uplugging your USB key drive), you can create another batch file called USBoff.cmd. Replace the second line of USBon.cmd with:
subst v: /D
Of course, you need to change v: to whatever drive letter you have chosen to assign to your USB key drive.
Double-clicking on USBoff.cmd while your USB key is still plugged in will manually remove the substituted drive letter. Your USB drive will still be accessible under whatever letter the host computer originally assigned. (BTW, this only works while your USB key drive is plugged in, because the USBoff.cmd batch file will not be accessible when the key is unplugged.)

Hope that helps.

-Yucca

User avatar
degaa
Posts: 6
Joined: Sat Oct 27, 2007 7:56 am
Location: Brazil

#7 Post by degaa »

Yucca,

I like your solution, it's very good but I would like not to click on the USBon.cmd file. Is there a chance of making the pendrive to do itself automatic?

Many thanks

Darkbee
Posts: 291
Joined: Mon Feb 06, 2006 8:35 am
Contact:

#8 Post by Darkbee »

I assume RocketDock doesn't let you use relative paths?

M@tty
Posts: 192
Joined: Wed May 02, 2007 9:32 am
Contact:

#9 Post by M@tty »

degaa wrote:I like your solution, it's very good but I would like not to click on the USBon.cmd file. Is there a chance of making the pendrive to do itself automatic?
Autorun.inf in root of Flash drive:

Code: Select all

[autorun]
action=Substitute USB Drive Letter
shellexecute=USBon.cmd
label=RocketDock Pen Drive
If you don't want to see the console window, download NirCmd, stick it in the root of the flash drive and use:

Code: Select all

shellexecute=nircmd.exe execmd CALL .\USBon.cmd
in place of shellexecute=USBon.cmd

This won't execute 100% automatically though unless you have a U3 drive. Removeable drives do not autorun on Windows XP, you have to click the "Substitute USB Drive Letter" instruction (which will automatically pop up).

User avatar
degaa
Posts: 6
Joined: Sat Oct 27, 2007 7:56 am
Location: Brazil

#10 Post by degaa »

Matty,

Thanks for your help, it's exactly what I was looking for. Now I just need to know how to start Rocket Dock automatically.
This forum is really great and I would like do thank everyone that is helping with opinions and solutions.

M@tty
Posts: 192
Joined: Wed May 02, 2007 9:32 am
Contact:

#11 Post by M@tty »

Not a problem.

If you want to start Rocket Dock automatically, just make USBOn.cmd read as follows:

Code: Select all

@echo off 
subst v: %cd%
RocketDock.exe
exit
Replace RocketDock.exe with whatever the name of the Rocket Dock executable is. Then change Autorun.inf to make more sense (Assumes you are using NirCmd):

Code: Select all

[autorun] 
action=Start Rocket Dock with drive letter V: 
shellexecute=nircmd.exe execmd CALL .\USBon.cmd
label=Rocket Dock Pen Drive

User avatar
degaa
Posts: 6
Joined: Sat Oct 27, 2007 7:56 am
Location: Brazil

#12 Post by degaa »

Rocket Dock is not able to start itself with this code.
And I would like to know if its possible to write a script that could end all the process running into the pendrive.

M@tty
Posts: 192
Joined: Wed May 02, 2007 9:32 am
Contact:

#13 Post by M@tty »

degaa wrote:Rocket Dock is not able to start itself with this code.
Descriptive feedback. :roll:

Error message?

Did you change RocketDock.exe to the Rocket Dock file path, like I told you to?
degaa wrote:And I would like to know if its possible to write a script that could end all the process running into the pendrive.
Anything is possible.

http://www.google.com - Heard of it? I've tried to help you but you should also try to help yourself, all the information is out there.

laurentxp
Posts: 3
Joined: Tue Nov 13, 2007 7:06 am

#14 Post by laurentxp »


User avatar
degaa
Posts: 6
Joined: Sat Oct 27, 2007 7:56 am
Location: Brazil

Now is working- How do end all process and disconect?

#15 Post by degaa »

Now is working fine to connect, assign the lettter and start Rocket Dock automatically.
I would like to know it is possible do add some lines in the USBoff.cmd
to end all the process running in the device before disconnect.

Post Reply