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

#21 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,433
  • 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,433
  • 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,433
  • 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,433
  • 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,433
  • 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


#32 User is offline   wimb 

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

Posted 28 December 2008 - 02:00 AM

ddlist.cmd is very handy and is giving for each drive all important identification parameters in one line.

Now it is easy to relate drive letter to harddisk and partition number.

For the layout it might be preferable to use no TAB and to make it similar to symbol2mvol.cmd

Thanks jaclaz for this batch program :)

#33 User is offline   jaclaz 

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

Posted 28 December 2008 - 06:01 AM

new version ddlistw on the same link:
http://www.boot-land...?showtopic=8219

jaclaz

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


#34 User is offline   wimb 

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

Posted 29 December 2008 - 01:22 AM

Just for comparison with BootLand Forum http://www.boot-land.net/forums/index.php?...=6492&st=10

Let's test the following CODE and CODEBOX for Copy and Paste in Notepad
using different Browsers:

CODE
 
Copy this text from CODE or CODEBOX in your browser display and Paste in Notepad
The second line has SPACE separated Words
The   third   line   has   multiple   SPACE   separated   Words
The	fourth	line	has	TAB	separated	Words


The seventh line appears after empty fifth and sixth line
 


The result using IE7 as browser is interesting and the same as for BootLand.
On Copy in Notepad we see:
For CODE the TAB character is replaced by 4 Spaces, rest is OK
For CODEBOX all CR+LF are gone (everything in 1 line), but multiple SPACE and TAB are preserved
For CODEBOX all empty lines are lost, but reappear in Post Edit or Post Reply Box

How does this compare to Opera or FireFox as Browser ?

This post has been edited by wimb: 29 December 2008 - 03:14 AM


#35 User is offline   jaclaz 

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

Posted 29 December 2008 - 03:03 AM

Opera works correctly, 100% with CODEBOX, BUT with the CODE, TABs are converted in multiple (4) spaces. This latter behaviour is a known thing, and it is always a good idea when using TABs, to specify where they are.

I haven't a Firefox installed now, so I cannot say. :unsure:

jaclaz

#36 User is offline   wimb 

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

Posted 05 January 2009 - 11:40 AM

And Here are the results for Firefox:

Firefox Copy CODE to Notepad:
TAB is replaced by 4 SPACES, rest OK ;)

Firefox COPY CODEBOX to Notepad:
TAB and multiple SPACE are replaced by single SPACE :ph34r:
Rest (CR+LF and empty lines) displayed and Copy OK :thumbup

So Firefox is in this respect different as compared to IE7, but also NOT perfect ;)

BootLand Forum gives the same results for Firefox as compared to MSFN Forum

CONCLUSION:
The most safe way to get your prgram code is to use Copy from Post Reply Box and Paste in Notepad ;)

This post has been edited by wimb: 05 January 2009 - 11:52 AM


#37 User is offline   jaclaz 

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

Posted 06 January 2009 - 11:49 AM

View Postwimb, on Jan 5 2009, 07:40 PM, said:

CONCLUSION:
The most safe way to get your prgram code is to use Copy from Post Reply Box and Paste in Notepad ;)


MY CONCLUSION:
The most safe way, not only to get a program in CODEBOX, is to use a GOOD browser (read OPERA).

;)

jaclaz

#38 User is offline   ElrickLandon 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 04-April 10
  • OS:none specified
  • Country: Country Flag

Posted 06 November 2010 - 04:53 AM

Hi,

I just read this interesting topic, i would like to know if it's possible to remove space from %%A variable ?

I try to execute the following code :

Quote

for /F "tokens=1 delims=:\" %%A IN ('MOUNTVOL^|FINDSTR [A-Z]:\\') do net share %%A=%%A: /GRANT:"Tout le monde",FULL


Result is that the space in %%A will block the NET SHARE command.

Quote

c:\net share ........ E= .......... E: /GRANT:"Tout le monde",FULL

....... = space

I need to obtain the drive letter from MountVol without space behind.

Many Thks for your help.

Regards.

This post has been edited by ElrickLandon: 06 November 2010 - 04:58 AM


#39 User is offline   jaclaz 

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

Posted 06 November 2010 - 01:08 PM

View PostElrickLandon, on 06 November 2010 - 04:53 AM, said:

I need to obtain the drive letter from MountVol without space behind.

Go by steps. :)
Open a command prompt.
Run in it
MOUNTVOL
[ENTER]
How does the output look?
Now run
MOUNTVOL | FIND ":\"
[ENTER]
How does the output look?
Now run
FOR /F "tokens=1 delims=:" %A in ('MOUNTVOL ^| FIND ":\"') DO ECHO x%Ax
[ENTER]
How does the output look?
Now run
FOR /F "tokens=1 delims=: " %A in ('MOUNTVOL ^| FIND ":\"') DO ECHO x%Ax
[ENTER]
please note how the above has a [SPACE] between
"tokens=1 delims=:

and the closing double quote:
"

How does the output look? ;)

jaclaz

#40 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,363
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 07 November 2010 - 03:05 AM

View PostElrickLandon, on 06 November 2010 - 04:53 AM, said:

Hi,

I just read this interesting topic, i would like to know if it's possible to remove space from %%A variable ?

I try to execute the following code :

Quote

for /F "tokens=1 delims=:\" %%A IN ('MOUNTVOL^|FINDSTR [A-Z]:\\') do net share %%A=%%A: /GRANT:"Tout le monde",FULL


Result is that the space in %%A will block the NET SHARE command.

Quote

c:\net share ........ E= .......... E: /GRANT:"Tout le monde",FULL

....... = space

I need to obtain the drive letter from MountVol without space behind.

Many Thks for your help.

Regards.

Try using a few more lines! (attempting to compact everything on one line will not make your batch file run any faster)
@ECHO OFF
FOR /F "DELIMS=:\" %%A IN ('MOUNTVOL^|FINDSTR [C-Z]:\\') DO CALL :SUB %%A
GOTO :EOF
:SUB
NET SHARE %1=%1: /GRANT:"Tout le monde",FULL
Note I've changed the possible drive letters output to exclude A: and B: drives.

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