Topic: WMIC is not working properly  (Read 1612 times)

WMIC is not working properly
« on: August 13, 2012, 03:13:47 AM »

woopsboy

  • Apprentice
  • *
  • Date Registered: Aug 2012
  • Posts: 2
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
===============================================

Re: WMIC is not working properly
« Reply #1 on: August 13, 2012, 06:23:48 PM »

woopsboy

  • Apprentice
  • *
  • Date Registered: Aug 2012
  • Posts: 2
By using attached script, I manage to get WMI working on x86. You need WAIK 3.0 SP1 .
« Last Edit: August 16, 2012, 01:26:22 AM by Galapo, Reason: Removed attachment »

Re: WMIC is not working properly
« Reply #2 on: August 16, 2012, 01:29:28 AM »

Galapo

  • Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 2207
Hi woopsboy,

Welcome to the forum!

 :welcome:

Thanks for working on a script for WMI. However, I edited your post above as the script includes encoded files which I don't think can be redistributed. It's better to copy such files from the source. :smile:

Regards,
Galapo.
« Last Edit: August 17, 2012, 11:43:58 AM by Galapo »

 

Powered by EzPortal