Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

more compatible batch file for ording drive letters


  • Please log in to reply
41 replies to this topic

#26
wimb

wimb

    Senior Member

  • Developer
  • 679 posts
  • Joined 21-March 07

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

Nice presentation :)

Thanks for this HANDY Program ;)

wimb
USB Booting - UEFI_MULTI

MBR-Backup - Make-PE3

--------------------


How to remove advertisement from MSFN

#27
victor888

victor888

    Member

  • Member
  • PipPip
  • 155 posts
  • Joined 20-October 04
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
victor888

victor888

    Member

  • Member
  • PipPip
  • 155 posts
  • Joined 20-October 04
Diskpart and fsutil are no longer needed.
I found the secret in registry.
I am compositing the batch now.

#29
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,657 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

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


GOOD news. :)

jaclaz

#30
wim

wim
  • Member
  • 6 posts
  • Joined 05-March 06
Hi Jaclaz, function have been added.

http://www.msfn.org/...rs-t125992.html

Wim

Edited by wim, 21 November 2008 - 04:00 PM.


#31
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,657 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
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>ddlistDrives 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

Edited by jaclaz, 16 July 2009 - 10:47 AM.


#32
wimb

wimb

    Senior Member

  • Developer
  • 679 posts
  • Joined 21-March 07
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 :)
USB Booting - UEFI_MULTI

MBR-Backup - Make-PE3

--------------------

#33
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,657 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
new version ddlistw on the same link:
http://www.boot-land...?showtopic=8219

jaclaz

Edited by jaclaz, 16 July 2009 - 10:48 AM.


#34
wimb

wimb

    Senior Member

  • Developer
  • 679 posts
  • Joined 21-March 07
Just for comparison with BootLand Forum http://www.boot-land...?...=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 NotepadThe second line has SPACE separated WordsThe   third   line   has   multiple   SPACE   separated   WordsThe	fourth	line	has	TAB	separated	WordsThe 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 ?

Edited by wimb, 29 December 2008 - 03:14 AM.

USB Booting - UEFI_MULTI

MBR-Backup - Make-PE3

--------------------

#35
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,657 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
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
wimb

wimb

    Senior Member

  • Developer
  • 679 posts
  • Joined 21-March 07
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 ;)

Edited by wimb, 05 January 2009 - 11:52 AM.

USB Booting - UEFI_MULTI

MBR-Backup - Make-PE3

--------------------

#37
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,657 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

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
ElrickLandon

ElrickLandon

    Newbie

  • Member
  • 14 posts
  • Joined 04-April 10
  • OS:none specified
  • Country: Country Flag
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 :

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.

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.

Edited by ElrickLandon, 06 November 2010 - 04:58 AM.


#39
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,657 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

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
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,557 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

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 :

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.

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.

#41
ElrickLandon

ElrickLandon

    Newbie

  • Member
  • 14 posts
  • Joined 04-April 10
  • OS:none specified
  • Country: Country Flag
Thanks to all for your answer, if i use this code is it more correct ?

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


#42
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,557 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

No it is not!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users