• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

How to make the Partion Letter for my memeory stick static ?

Hello Guys,

I've got a memory stick, and I want to keep the partion letter constant anywhere I use my memory stick, for example whenever I insert my memory stick in any computer, I want to get the letter T: , so if my memory stick had the folder called 'example'. this folder will always be T:\example\

Now, that question was asked on Experts Exchange before, http://www.experts-exchange.com/OS/Miscellaneous/Q_26722200.html , upon the answers, I made these 2 files and put them in the root folder of my memory stick.

autorun.inf
[autorun]
label=MH Memory
Action=Check USB Drive on T
shellexecute=drived.cmd

Open in new window


DRIVED.CMD
SET USBDRIVE=T
SET CURRENTDRIVE=%~d0
SET WRONGVOLUME=
SET CURRENTVOLUME=

IF /i "%CURRENTDRIVE:~0,1%" == "%USBDRIVE%" EXPLORER.EXE /ROOT,%~d0\

CD /d %temp%

ECHO list volume>diskpart.txt

for /f "tokens=2" %%a in ('diskpart /s diskpart.txt ^| FIND /i " %CURRENTDRIVE:~0,1% "') do Set CURRENTVOLUME=%%a
for /f "tokens=2" %%a in ('diskpart /s diskpart.txt ^| FIND /i " %USBDRIVE% "') do Set WRONGVOLUME=%%a

DEL DISKPART.TXT
IF Defined WRONGVOLUME (
    echo SELECT VOLUME %WRONGVOLUME% >>DISKPART.TXT
    echo REMOVE LETTER=%USBDRIVE% >>DISKPART.TXT
)

echo SELECT VOLUME %CURRENTVOLUME% >>DISKPART.TXT
echo ASSIGN LETTER=%USBDRIVE% >>DISKPART.TXT

IF Defined WRONGVOLUME (
    echo SELECT VOLUME %WRONGVOLUME% >>DISKPART.TXT
    echo ASSIGN LETTER=%CURRENTDRIVE:~0,1% >>DISKPART.TXT
)
DISKPART /s DISKPART.TXT
DEL /q DISKPART.TXT

Open in new window


They work fine on my laptop, the problem is it doesn't work in public pc's where I don't have admin privileges, is there some way to overcome this problem? I desperately need to fix this issue, i.e. when double-clicking driver.cmd it doesn't change the drive letter at all in public pc's :(

Please Help
0
adkry
Asked:
adkry
2 Solutions
 
slightwv (䄆 Netminder) Commented:
PCs are bound by the rules of the admin.  More so on 'public' ones.

I doubt they will let you make these types of 'demands' on their systems.

Would you let someone run DISKPART on your home computer?

I sure hope not...

Odds are you cannot control this on a computer you cannot control.



0
 
nobusCommented:
try this instead :  http://www.uwe-sieber.de/usbdlm_e.html      
0
 
adkryAuthor Commented:
USBDLM requires admin priveleges to install as well, seems there's no way around this.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now