victor888 Posted November 14, 2008 Posted November 14, 2008 (edited) 1. Can fix flash disk driver letter:Seletion to fix flash disk driver letter:set USBDRV=U"U" is your flash drive letter to be fixed, you may change it as your need.For FIXED USB DISK (usb hard disk or fixed type usb disk) this selection nas no meaning.Also it is not fit to the condition that more than 1 flash disk exists.Do be sure that flash USB drive letter is not confilict with any other existing drive letter. 1. support WIN7 (WIN7 PE).2. support VHD disk recognition.3. code optimized.4. add Automated run selection.selection for automated run set AUTO=n (default is n, which means no intercourse needed. if AUTO was set to y, means automatic mode is opened.)===Special thanks to Jaclaz.===Function: order messed drive letters caused by, for example, installing xp from usb (removabe or hard disk), startting pe from usb etc.Win command used: reg (to query information from registry), find (combine with other command), wimc (to get all drive letters. For PE, all drive letters are find from registry ), mountvol (to change drive letters), diskpart.exe (to get disk drive letters, only for diskpart version)Workround: This batch work under winpe and winnt systems(XP,2k3,vista and WIN7).Note:1. Don not run subst or net use prior to running it.mbrfix.rar Edited February 27, 2011 by victor888
victor888 Posted November 14, 2008 Author Posted November 14, 2008 (edited) If you have any difficulties in understanding this batch, just let me know. I will give details. Edited November 20, 2008 by victor888
jaclaz Posted November 20, 2008 Posted November 20, 2008 (edited) Jaclaz try this again.Will do, thanks. ...and let you know ....jaclazP.S.: Quicly tested, it doesn't work (properly) for me, though I see it as a great improvement over the "old" one C:\Downloaded\victor888>regorderdrvall drive letters: C D E G H I J K L M N Rmounted drive letters: i C E D R N G H I J K L Mvirtual drive letters:internal hard disk 1 drive letter: CErrore: impossibile trovare la chiave del Registro di sistema o il valore specificatoErrore: impossibile trovare la chiave del Registro di sistema o il valore specificatousb hard disk 1 drive letters: Eusb hard disk 2 drive letters: J K L Mfloppy drive letters:cd/dvd rom drive letters: Dremmovalbe drive letters: i R N G H ILegend:Errore: impossibile trovare la chiave del Registro di sistema o il valore specificato=Error cannot find specified Registry key or valueReal situation:1) internal (SATA) drives: C:, E: 2) CD D: 3) USB hard disk J: K: L: M: 4) Removable (SD card reader, 4 slots) G: H: I: N:5) Virtual disk (removable - Perioft demo driver) R: Edited November 20, 2008 by jaclaz
victor888 Posted November 21, 2008 Author Posted November 21, 2008 (edited) Ok, mounted drive letter "i" is incorrect.Please show me the result of MOUNTVOL.EXE.For drive letter R:, it must have has a volume id and been recognized as removable device. Edited November 21, 2008 by victor888
victor888 Posted November 21, 2008 Author Posted November 21, 2008 OK, I will get mount point from registry, not from MOUNTVOL.EXE and make optimization.
jaclaz Posted November 24, 2008 Posted November 24, 2008 (edited) VERY GOOD WORK! Still something that must be taken into account (I know I am picky, but that should be the right attitude for "testers") :regorderdrvAll drive letters: C D E F G H I N R XMounted drive letters: C E D R N G H IVirtual drive letters: FXInternal hard disk 1 drive letter: CInternal hard disk 2 drive letter: EInternal hard disk 3 drive letter: {80cf88c6-8a34-11dd-813c-806d6172696f}I {80cf88c6-8a34-11dd-813c-806d6172696f}I {80cf88c6-8a34-11dd-813c-806d6172696f}I {80cf88c6-8a34-11dd-813c-806d6172696f}ICd/dvd rom drive letters: DRemmovalbe drive letters: R N G H IsubstX:\: => C:\WINPE BUILDER\XI added a SUBST drive, just to see how it would behave. C: and E: are Internal Fixed DisksD: is CD-ROMF: is a IMDISK Virtual DiskX: is the SUBSTed driveR: is the Perisoft Virtual DiskN: G: H: I: are partitions on external USBA small typo:Remmovalbe Removable drive letters: R N G H IThe listed virtual drive letters miss a separator.I would use the "normal" convention of colons and the comma as separator, like:All drive letters: C:, D:, E:, F:, G:, H:, I:, N:, R:, X:I will try a combo of more Virtual Disks and post results....jaclazP.S.:@ALLIf you want to test this batch, add a GOTO :EOF here:GOTO :EOF::remove system drive letters and volume idsso that drive letters are NOT re-ordered Edited November 24, 2008 by jaclaz
victor888 Posted November 24, 2008 Author Posted November 24, 2008 (edited) Perhaps I am lost in registry searching.This CMD will take usb hard disk as internal hard disk if booted with pe on usb hard disk and drive letter c belongs to it.Sometimes when boot pe, no "diskperipheral " value found in registy which reselts to no internal hard disk found. Edited November 25, 2008 by victor888
jaclaz Posted December 3, 2008 Posted December 3, 2008 No joy yet (version dated 30/11/2008). regorderdrvAll drive letters: C D E F G H I J K L M N OMounted drive letters: C D I J K L M N E G H O FInternal hard disk 1 drive letter: CUsb hard disk 1 drive letters: DUsb hard disk 2 drive letters: E G H OCd/dvd rom drive letters: IRemmovalbe drive letters: J K L M N FD: is second internal hard disk.E: G: H: O: are first (and only) USB HD.There is no distinction among the various Remmovalbe Removable drives:F: is a USB stickJ: is Perisoft Virtual SCSI diskK: L: M: N: are USB Card Reader Combo.You "changed the rules" of the game, however. The point was - at least in my mind - to use no external utility, otherwise most of the fun would be lost. It will take me some time to check the batch code, will let you know If I find where the problem might be....Cheers,jaclaz
victor888 Posted December 3, 2008 Author Posted December 3, 2008 (edited) Thank you very much, you poitns its bug, second hard disk wrong.I disklike break the rule too.I have to use dispart to replace mbrfix.a revised version will coming soon. Edited December 3, 2008 by victor888
jaclaz Posted December 6, 2008 Posted December 6, 2008 I like to play along the rules of the "game" Try the attached. A bit slowish, needs polishing and betterings, but maybe we're getting somewhere . (only REG.EXE and MOUNTVOL.EXE is used, NO temporary files)Cheers,jaclazlistdrives.zip
victor888 Posted December 7, 2008 Author Posted December 7, 2008 (edited) Well done.A:C: 0,0 IDE FixedD: 0,1 IDE FixedE: 0,2 IDE FixedF: 0,3 IDE FixedG: 0,4 IDE FixedH: 0,5 IDE FixedI: 0,6 IDE FixedJ: 0,7 IDE FixedK: 0,8 IDE FixedL: IDE CD-ROMM: FixedN: 1,0 USB RemovablO: 3,0 USB RemovablP: 4,0 USB RemovablQ: 5,0 USB RemovablR: FixedThe result is correct.One problem is it doesn't tell where are USB hard disk drive letters type (M: R:). Only give FIXED drive letter.Addition: for winpe, sometimes no item under DISKPERIPHERAL, so no signature found.Anoter thing, this batch doesn't arrange drive letters according to volume order.I should further examine your code.thanks. Edited December 7, 2008 by victor888
jaclaz Posted December 7, 2008 Posted December 7, 2008 (edited) It works for my USB external hard disk:C: 0,0 IDE FixedD: 1,0 IDE FixedE: 7,0 USB FixedG: 7,1 USB FixedH: 7,2 USB FixedI: IDE CD-ROMJ: 2,0 SCSI RemovableK: 3,0 USB RemovableL: 4,0 USB RemovableM: 5,0 USB RemovableN: 6,0 USB RemovableO: 7,3 USB Fixed(letters E: G: H: O: ) Try using the /v switch and post output.....About ordering, at the end of the batch "main", after:FOR /F "Tokens=2 delims==" %%? IN ('SET LDrive') DO ECHO %%?and before:GOTO :EOFThese two lines:ECHO.FOR /F "Tokens=2 delims==" %%? IN ('SET LDrive ^|SORT /+14') DO ECHO %%?Output becomes this :C: 0,0 IDE FixedD: 1,0 IDE FixedE: 7,0 USB FixedG: 7,1 USB FixedH: 7,2 USB FixedI: IDE CD-ROMJ: 2,0 SCSI RemovableK: 3,0 USB RemovableL: 4,0 USB RemovableM: 5,0 USB RemovableN: 6,0 USB RemovableO: 7,3 USB FixedI: IDE CD-ROMC: 0,0 IDE FixedD: 1,0 IDE FixedJ: 2,0 SCSI RemovableK: 3,0 USB RemovableL: 4,0 USB RemovableM: 5,0 USB RemovableN: 6,0 USB RemovableE: 7,0 USB FixedG: 7,1 USB FixedH: 7,2 USB FixedO: 7,3 USB FixedWe could give a "fake" physical drive number to CD-ROM(s) to alter the order.PE is a different thing....Also I need to know how would a SATA CD/DVD behave....And however I am not so sure that entries in Services\Disk\Enum are the same as the output of WMIC.....this needs to be checked thoroughfully.EDIT:Checked, and unfortunately they do not correspond a similar batch using WMI gives different results:C: 0_0 IDE Fixed [HD] MAXTOR STM3320820ASD: 1_0 IDE Fixed [HD] MAXTOR STM3320820ASE: 3_0 USB Fixed [HD] SAMSUNG HD320KJ USB DeviceG: 3_1 USB Fixed [HD] SAMSUNG HD320KJ USB DeviceH: 3_2 USB Fixed [HD] SAMSUNG HD320KJ USB DeviceJ: 2_0 SCSI Removable [HD] Perisoft Virtual Disk SCSI Disk DeviceK: 4_0 USB Removable Generic USB SD Reader USB DeviceL: 5_0 USB Removable Generic USB CF Reader USB DeviceM: 6_0 USB Removable Generic USB SM Reader USB DeviceN: 7_0 USB Removable Generic USB MS Reader USB DeviceO: 3_3 USB Fixed [HD] SAMSUNG HD320KJ USB DeviceAdditionally mountvol does not detect IMDISK Virtual Disks :http://www.boot-land.net/forums/index.php?showtopic=3909I guess we need to find out how to manage correctly the entries in \DosDevices and forget about mountvol.The FREEDRV I wrote some time ago could be part of the solution...I will have to study it (I am getting old an cannot even say if it used mountvol or not....):http://www.911cd.net/forums//index.php?sho...=21965&st=6EDIT:Checked, no way to detect IMDISK volumes through Mountvol or Registry....jaclazP.S.: On the machine I tried it I don't have a floppy, thus it is not "detected" at all (there is NO code for it), but I think anyway that it would be advisable to simply "exclude" A: and B: from the mountvol command, you aren't going to change those drive letters, are you? Edited December 7, 2008 by jaclaz
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now