Lastdrive...



  • You guys know "lastdrive" env. var on old old dos shells?

     

    I've run on a funny problem these days, under WinXP. Some smart system guy made my partions like "C - Main, D - Data, Z - Personal". Also I've some network drives but they're mounted by scripts with their own drive letter... what's the WTF? Plug an Flash-Drive and let Win guess wich letter should it have...

     The Flash-Drive get's connected, detected, it's driver recognized and it apears under that "remove drive safetly" shortut... but, where the hell is this drive? No new drive appears on "My PC", explorer, cmd promtp, etc. So what do I need to access my flash-drive? Start a WinXP box withing a Virtual Machine in the same Win XP box and access the flash-drive from there.

     
    I think Win need an improved "findDriveLetter()" method! Any idea about the code? (if (lastDriveLetter == 'Z') break; //maybe? )

     



  • Hey, you can change the drive letters via Computer Management->Disk Management.  Just right click a drive and choose "Change Drive Letter and Paths".



  • When in doubt... Read the instruction manual?

    I mean really... You can't blame windows for every little thing that doesn't go your way... Especially if you don't know how to use it!

     



  • [quote user="MasterPlanSoftware"]I mean really... You can't blame windows for every little thing that doesn't go your way... Especially if you don't know how to use it! [/quote]Well, this is a Windows bug - if you have a network drive mapped just after your physical drives (eg. you have C:, D:, E: as physical drives and F: as a mapped network drive), and connect an USB drive, Windows will map it under the network drive. You can access the contents if you break the mapping, or if you go to Computer Management and assign another drive letter. Unfortunately, this only works until you restart your computer (and only if you use the same USB drive) - then the drive will again get mapped to the same letter as your network drive.



  • I haven't had that happen to me.  I have two USB sticks and use them in two USB sockets and WinXP remembers the drive letters for each even though I have about 8 mapped network drives.



  • [quote user="ender"]Well, this is a Windows bug - if you have a network drive mapped just after your physical drives (eg. you have C:, D:, E: as physical drives and F: as a mapped network drive), and connect an USB drive, Windows will map it under the network drive. You can access the contents if you break the mapping, or if you go to Computer Management and assign another drive letter. Unfortunately, this only works until you restart your computer (and only if you use the same USB drive) - then the drive will again get mapped to the same letter as your network drive.[/quote]

    I agree. We have a Novell Netware server here that, as usual, assigns drive F: to \\server\SYS. Since I have a couple of legacy drives in my machine, C:, D:, and E: are already in use. When I plugged in my USB drive, Windows assigned it to drive F: *after* Netware had mapped F: already. This left me with *two* F: drives in Windows explorer (with the correct labels of "Removable Disk" and "SYS on <servername>". Clicking on either drive, though, gave me the contents of the USB drive.

    The solution? Tell the Netware client software to make the first network drive G: instead of F:.

     
    Ken
     



  • [quote user="cbr600f"]

    I think Win need an improved "findDriveLetter()" method! Any idea about the code? (if (lastDriveLetter == 'Z') break; //maybe? )

    [/quote]

    Doesn't it do something normal? Like 'AA:' ? (they could reuse excel code ;) What actually happens when you get all the A..Z letters used and want to create a new disk?

    Anyway - Long live the /mnt, /media!



  • [quote user="viraptor"]

    What actually happens when you get all the A..Z letters used and want to create a new disk?Y

    [/quote]
    You can just mount the new drive as a directory under an existing drive letter (so C:\MyOtherDrive)



  • RTFM



  • [quote user="malfist"]RTFM[/quote]

     Manual?  Where?  What you get with XP can hardly be called a manual, so what are you refering to?
     



  • [quote user="viraptor"]

    [quote user="cbr600f"]

    I think Win need an improved "findDriveLetter()" method! Any idea about the code? (if (lastDriveLetter == 'Z') break; //maybe? )

    [/quote]

    Doesn't it do something normal? Like 'AA:' ? (they could reuse excel code ;) What actually happens when you get all the A..Z letters used and want to create a new disk?

    Anyway - Long live the /mnt, /media!

    [/quote]

     

    The original DOS logic was (65 + drivenumber) with A: being drive number zero, and the first partition on the first hard drive always being drive number 2 (drive number 1 being reserved for a second floppy drive).


    So if you had enough partitions to make it all the way to Z:, the next partition would be [:, then :, then ]:, then, ^:, _:, `:


    After that it would issue 'a:', which is indistinguishable from A: and thus was inaccessible.



  • Windows actually lets you use arbitrary characters for the drive letters (there's some sample code floating around for mapping drives this way), it's just that most programs won't let you access anything but A-Z (and many of those that can access eg. :: or _: can't access drive letters that use non-ANSI characters).



  • Ehm... Drive Z is not a network drive, it's a Physical Drive.

     

    If I start the system, remove Z partition or anything else that makes M be last drive instead of  Z, the USB-flash memory gets connected (as always) and it DOES get a drive letter.

     

    A: Disk

    HDA0 

    C: Main Partition 

    D: Data Partiiton

    Z: Personal Partition

    Network Drives:

    N: office stuff

    M: department stuff.

    The problem is that Z is a physical drive and USB, although connected, is not assigned a drive letter so nobody can access to it.

    However, if you start a virtual machine inside with *any other system* (solaris, linux or even windows), in that VM the USB is recognized (as usual) and it get's it's drive letter.

     
    Is just simple, you cannot have a drive beyond Z, and somebody forgot to search for an empty drive letter instead of lastLetter++.

    That's the WTF... I'm not blaming win, just though it was fun.
     



  • That is weird - physical drives on my home computer are B,C,D,E,F,G,H,I,J,M,N,O,R,S,X (don't ask), network drives are P,Q,Y,Z, and USB devices usually get K and L (except for my HDD MP3 player, which always gets T - I wish I knew how this happened, so I could reproduce it on other machines where I get the USB-drive-hides-under-network-drive bug I mentioned earlier).

    BTW, why does this editor randomly start replacing spaces with non-breaking spaces?


Log in to reply