Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Script producing ""Not enough storage is available to complete..."

Reply
 
Old 10-01-2008   #1 (permalink)
IainM


 
 

Script producing ""Not enough storage is available to complete..."

My vbscript is producing the error ""Not enough storage is available to
complete this operation" when it connects to another server in the same
domain to enumerate disks and check free disk space.
The subroutine (incuded below) works for other servers, but not the same 2
every time it runs.
How do I troubleshoot/fix this?

Sub DisplayExchangeKVSBladesFreeSpace(strServerName)
Const HARD_DISK = 3
Dim objWMIService, colDisks, objDisk
Dim ActualFreeSpaceGb

on error resume next

Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strServerName & "\root\cimv2")

Set colDisks = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk
Where DriveType = " & HARD_DISK & "")

wscript.echo " Free disk space on " & ucase(strServerName)
wscript.echo
wscript.echo " Minimum"
wscript.echo "Drive Free space allowed"
wscript.echo "-------------------------------"

For Each objDisk In colDisks
strWarning = ""
ActualFreeSpaceGb = objDisk.FreeSpace/1073741824

wscript.echo objDisk.DeviceID & vbtab &
formatnumber(ActualFreeSpaceGb,2,,,-2) & " Gb" &
space(16-len(formatnumber(ActualFreeSpaceGb,2,,,-2) & " Gb"))

Next
End Sub

Thanks for any help.

Iain

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
do not display "ERRORS" when running script without using $erroractionpreference = "SilentlyContinue" PowerShell
Texas Instruments PCI GemCore based SmartCard controller producing"page_fault_in_non_paged_area" Vista hardware & devices
Deleted "Outbox" from "Storage folders", reappears as seperate item Live Mail
Vista not wotking with "My Computer" or "Control Panel", "Screen Saver" Vista General
Should "script" be listed as a "reserved word" PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46