MSFN Forum: more compatible batch file for ording drive letters - MSFN Forum

Jump to content


  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

more compatible batch file for ording drive letters updated on 1 Nov. 2008

#12 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 20 October 2008 - 01:33 PM

Not yet had enough time to go through it, however, it seems to me that you forget the possibility of a SCSI drive and of a Removable SCSI drive.

Get the the Perisoft minifile and miniram drivers and try it:
http://www.perisoft....iport/index.htm

jaclaz


#13 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 20 October 2008 - 04:43 PM

SCSI drive is concerned too.

This post has been edited by victor888: 20 October 2008 - 09:34 PM


#14 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 22 October 2008 - 08:07 AM

I had a somewhat deeper look at the batch.

It is a GOOD idea and the code is OK :thumbup BUT, in a nutshell, I do not like it. :blink:

I mean, I feel like it is overly complex, and it is possible that it won't work on some localized versions. (changing the "Removable" to "mov" should cover a number of European ones)

I did a couple of check and some temp files can be made unneeded.

Still, I could not find a way to manage diskpart without a temp file.

While researching about it, I found something I had never seen (or better never paid attention to) that may be a better approach:
WMIC (Windows Management Instrumentation Command):
http://www.ss64.com/nt/wmic.html
http://www.robvander...e.com/wmic.html
http://www.robvander...com/wmigen.html
http://www.robvander...arrays_bat.html

Maybe this could be a "slimmer" approach. :unsure:

Check the attached example.

jaclaz

Attached File(s)


This post has been edited by jaclaz: 22 October 2008 - 08:10 AM


#15 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 22 October 2008 - 08:18 AM

I need your optimized version.
I think of using wmic but do not study it.
Your sample is really very good.
WMIC command is too powerful.

This post has been edited by victor888: 22 October 2008 - 09:38 AM


#16 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 27 October 2008 - 07:45 AM

WMI is too powerful, most valuable link: http://www.windows-management.com/scriptin...cal/#ADPPDD.htm

FOR WIN2K3 AND VISTA diskpart, mountvol etc are of no use.

This post has been edited by victor888: 27 October 2008 - 08:32 PM


#17 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 28 October 2008 - 12:58 AM

View Postvictor888, on Oct 27 2008, 02:45 PM, said:

WMI is too powerful, most valuable link: http://www.windows-management.com/scriptin...cal/#ADPPDD.htm


Nice VBS script. :)

I'll try to replicate it's approach.

jaclaz

#18 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 28 October 2008 - 01:45 AM

Jaclaz go!

I am studying wmi/wmic these days too, hope an smart script come out ealier under your work and my support.

#19 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 29 October 2008 - 05:44 AM

Find attached another example.

Nothing actually working, but a little step further. :unsure:


Check testwmic3.cmd:
Finding the escaping characters needed to use the "Where" operator with the value "Disk #m, Partition #n" and redirecting failing instances to nul can only be described as a nightmare! :w00t:

Rule seems to be that you need to enclose the Where argument into brackets () to be able to use the quotes "" inside it, and when in a FOR loop:
equal sign = needs to be escaped
quotes " and commas , (that normally would need to be escaped) need NOT to be escaped


jaclaz

Attached File(s)



#20 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 29 October 2008 - 06:55 AM

Very good example. I will study it asap.

#21 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 01 November 2008 - 04:33 AM

It seems to me that after all WMIC is not "the" solution, but it may be part of it.

I seem not to be able through WMIC to "find a relationship" between PHYSICALDRIVEs and LogicalDrives when the device is "Removable".

Moreover it seems like the available data go as deep as finding Extended Partitions but not deep enough to find Logical Volumes inside them.

Find attached another example, it seems to me that it gathers all available data through WMIC. :unsure:

jaclaz

Attached File(s)



#22 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 01 November 2008 - 05:15 AM

you make more progress in using wmic.
I will try to continue.

#23 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 02 November 2008 - 06:28 AM

Almost, but not quite, completely unrelated ;)
symbol2mvol.cmd


Uses:
Listdosdevices:
http://www.uwe-siebe...ivetools_e.html

VLM (part of the DSFOK package):
http://members.ozema...eezip/freeware/

Output sample:
C:\Downloaded\victor888>symbol2mvol
C: FIX \\.\Volume{b0b284c3-8a33-11dd-8781-806d6172696f} \HarddiskVolume1
D: CDR \\.\Volume{80cf88c2-8a34-11dd-813c-806d6172696f} \CdRom0
E: FIX \\.\Volume{b0b284c4-8a33-11dd-8781-806d6172696f} \HarddiskVolume2
G: REM \\.\Volume{80cf88c4-8a34-11dd-813c-806d6172696f} \Harddisk4\DP(1)0-0+b
H: REM \\.\Volume{80cf88c5-8a34-11dd-813c-806d6172696f} \Harddisk5\DP(1)0-0+c
I: REM \\.\Volume{80cf88c6-8a34-11dd-813c-806d6172696f} \Harddisk6\DP(1)0-0+d
J: FIX \\.\Volume{98f06d4c-9506-11dd-8147-001fc6bb76ce} \HarddiskVolume3
K: FIX \\.\Volume{98f06d4d-9506-11dd-8147-001fc6bb76ce} \HarddiskVolume4
L: FIX \\.\Volume{98f06d4e-9506-11dd-8147-001fc6bb76ce} \HarddiskVolume5
M: FIX \\.\Volume{98f06d4f-9506-11dd-8147-001fc6bb76ce} \HarddiskVolume6
N: REM \\.\Volume{80cf88c3-8a34-11dd-813c-806d6172696f} \Harddisk3\DP(1)0-0+a
S: REM \\.\Volume{5d3e8800-9c1f-11dd-8148-001fc6bb76ce} \Harddisk2\DP(1)0-0+5


Runnning listdosdevices with a /? parameters outputs a mess of data, maybe it can be useful. :unsure:

A similar app is dosdev:
http://www.ltr-data.se/opencode.html

and on the same page there is devioctl.

Devioctl with the GEOMETRY <drive> parameters gives the needed info, <drive> can be:
  • drive letter
  • PhysicalDriven

(but it won't work -obviously- :unsure: for Removable devices where no media is inserted :()

jaclaz

Attached File(s)


This post has been edited by jaclaz: 02 November 2008 - 06:29 AM


#24 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 04 November 2008 - 09:16 AM

I found one more powerfull disk tool here: http://technet.microsoft.com/zh-cn/sysinte...648(en-us).aspx

DiskExt v1.1 which gives each disk it mount volume and drive letters.

#25 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 04 November 2008 - 10:30 AM

View Postvictor888, on Nov 4 2008, 04:16 PM, said:

DiskExt v1.1 which gives each disk it mount volume and drive letters.


Yep :), but it won't give you ANY more info than mountvol for Removable devices like SD card readers when there is no media in them.....:(

A more useful app is the dd for windows version by John Newbigin:
http://www.chrysocome.net/dd

try running
dd --list


;)

jaclaz

This post has been edited by jaclaz: 04 November 2008 - 10:33 AM


#26 User is offline   wimb 

  • Senior Member
  • Group: Developers
  • Posts: 633
  • Joined: 21-March 07

Posted 04 November 2008 - 10:54 AM

View Postjaclaz, on Nov 2 2008, 02:28 PM, said:

Almost, but not quite, completely unrelated ;)
symbol2mvol.cmd

Nice presentation :)

Thanks for this HANDY Program ;)

wimb

#27 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 04 November 2008 - 09:33 PM

In fact ervery thing about disk information is in the registry. I will try to get my answer there and not use others tool.

#28 User is offline   victor888 

  • Member
  • PipPip
  • Group: Members
  • Posts: 155
  • Joined: 20-October 04

Posted 08 November 2008 - 06:07 AM

Diskpart and fsutil are no longer needed.
I found the secret in registry.
I am compositing the batch now.

#29 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 08 November 2008 - 06:54 PM

View Postvictor888, on Nov 8 2008, 01:07 PM, said:

Diskpart and fsutil are no longer needed.
I found the secret in registry.
I am compositing the batch now.


GOOD news. :)

jaclaz

#30 User is offline   wim 

  • Group: Members
  • Posts: 6
  • Joined: 05-March 06

Posted 18 November 2008 - 06:14 PM

Hi Jaclaz, function have been added.

http://www.msfn.org/board/Switching-drive-...rs-t125992.html

Wim

This post has been edited by wim: 21 November 2008 - 04:00 PM


#31 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,458
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 27 December 2008 - 05:31 AM

Just to keep things as together as possible, here:
http://www.boot-land...?showtopic=8219

is a small batch to take advantage of the features of the dd --list mentioned before.

Example output:
 
C:\VSS>ddlist
Drives by drive letter:
c: 0,1 Fixed     HarddiskVolume1        {b0b284c3-8a33-11dd-8781-806d6172696f}
d: 1,1 Fixed     HarddiskVolume2        {b0b284c4-8a33-11dd-8781-806d6172696f}
e: 3,1 Fixed     HarddiskVolume3        {98f06d4c-9506-11dd-8147-001fc6bb76ce}
f: 8,1 Fixed     HarddiskVolume11       {0cb309be-d343-11dd-ab05-001fc6bb76ce}
g: 3,2 Fixed     HarddiskVolume4        {98f06d4d-9506-11dd-8147-001fc6bb76ce}
h: 3,3 Fixed     HarddiskVolume5        {98f06d4e-9506-11dd-8147-001fc6bb76ce}
i: x,x CD-ROM    CdRom0                 {80cf88c2-8a34-11dd-813c-806d6172696f}
j: 2,1 Removable Harddisk2\DP(1)0-0+5   {5d3e8800-9c1f-11dd-8148-001fc6bb76ce}
k: 4,1 Removable Harddisk4\DP(1)0-0+f   {80cf88c3-8a34-11dd-813c-806d6172696f}
l: 5,1 Removable Harddisk5\DP(1)0-0+10  {80cf88c4-8a34-11dd-813c-806d6172696f}
m: 6,1 Removable Harddisk6\DP(1)0-0+11  {80cf88c5-8a34-11dd-813c-806d6172696f}
n: 7,1 Removable Harddisk7\DP(1)0-0+12  {80cf88c6-8a34-11dd-813c-806d6172696f}
o: 3,4 Fixed     HarddiskVolume6        {98f06d4f-9506-11dd-8147-001fc6bb76ce}
Premere un tasto per continuare . . .

Drives by connection:
c: 0,1 Fixed     HarddiskVolume1        {b0b284c3-8a33-11dd-8781-806d6172696f}
d: 1,1 Fixed     HarddiskVolume2        {b0b284c4-8a33-11dd-8781-806d6172696f}
j: 2,1 Removable Harddisk2\DP(1)0-0+5   {5d3e8800-9c1f-11dd-8148-001fc6bb76ce}
e: 3,1 Fixed     HarddiskVolume3        {98f06d4c-9506-11dd-8147-001fc6bb76ce}
g: 3,2 Fixed     HarddiskVolume4        {98f06d4d-9506-11dd-8147-001fc6bb76ce}
h: 3,3 Fixed     HarddiskVolume5        {98f06d4e-9506-11dd-8147-001fc6bb76ce}
o: 3,4 Fixed     HarddiskVolume6        {98f06d4f-9506-11dd-8147-001fc6bb76ce}
k: 4,1 Removable Harddisk4\DP(1)0-0+f   {80cf88c3-8a34-11dd-813c-806d6172696f}
l: 5,1 Removable Harddisk5\DP(1)0-0+10  {80cf88c4-8a34-11dd-813c-806d6172696f}
m: 6,1 Removable Harddisk6\DP(1)0-0+11  {80cf88c5-8a34-11dd-813c-806d6172696f}
n: 7,1 Removable Harddisk7\DP(1)0-0+12  {80cf88c6-8a34-11dd-813c-806d6172696f}
f: 8,1 Fixed     HarddiskVolume11       {0cb309be-d343-11dd-ab05-001fc6bb76ce}
i: x,x CD-ROM    CdRom0                 {80cf88c2-8a34-11dd-813c-806d6172696f}
Premere un tasto per continuare . . .
 


jaclaz

This post has been edited by jaclaz: 16 July 2009 - 10:47 AM


Share this topic:


  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy