Created
July 9, 2014 16:09
-
-
Save icheko/32b76c44064aeba3ae79 to your computer and use it in GitHub Desktop.
VBScript write free disk space to file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Const ForAppending = 8 | |
Set objWMIService = GetObject("winmgmts:") | |
Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='s:'") | |
set objFSO = CreateObject("Scripting.FileSystemObject") | |
set objFile = objFSO.OpenTextFile("c:\DAS_free_space.txt", ForAppending, True) | |
objFile.WriteLine(FormatNumber((CDbl(objLogicalDisk.FreeSpace)/1024/1024/1024)) & ",") | |
objFile.Close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment