1.

Solve : Get Drives.?

Answer»
Hi ! to all.

I REQUEST TO MY ALL DEAR FRIEND.

i want to get all my PC's drive latter in ARRAY in to display. like i GO in DISKPART in this list volume we show all volume of drive but i want that programming to how to do this ?? Batch code can only handle text, not arrays which are objects. You can use the for command to parse the OUTPUT from this little snippet.

Code: [Select]@echo off
fsutil fsinfo drives

Good luck.

Thanks for the Replay ...

But it is possible to store in any variable ...... like in %%a or like that!!

i try FOR command but i only enter in diskpart i can't get all dive so pls help me.

Thanks.
I'm still not certain what it is you want.

This snippet will show only the drive letters and drive labels:
Code: [Select]@echo off
echo list volume > diskpart.txt
echo exit >> diskpart.txt
for /f "skip=8 tokens=3-4" %%i in ('diskpart /s diskpart.txt') do (
echo %%i: %%J
)
del diskpart.txt

This snippet will show all the fields:
Code: [Select]@echo off
echo list volume > diskpart.txt
echo exit >> diskpart.txt
for /f "skip=6 tokens=*" %%i in ('diskpart /s diskpart.txt') do (
echo %%i
)
del diskpart.txt

Good luck.

I try this.

Thanks for the replay.


Discussion

No Comment Found