I have some problem with WMIC as this:
social.technet.microsoft.com/Forums/en-US/mdt/thread/5e79d72c-f7fd-4a5c-a82e-1296d0304c3a/
How do I fix this problem. I need WMIC to find hard disk drive with biggest free space:
====================================
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
Set LargestFreeSpace=0000000000000
For /F "Tokens=1,2,3" %%I In ('wmic logicaldisk get DriveType^,freespace^,name^') Do (
If %%I==3 (
Set CurFreeSpace=0000000000000%%%J
If !CurFreeSpace:~-13! GTR !LargestFreeSpace! (
Set LDrive=%%K
Set LargestFreeSpace=!CurFreeSpace:~-13!
)
)
)
echo. !LDrive!
echo. !LargestFreeSpace!
EndLocal
===============================================