Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: FileSizeEX Returns Zero 0 Pagefile.sys
Is there a reason why the command isn't returning the size of the file? Is there a better command to run to find out the setting for the pagefile?
;-------------------------------------------------------------------------------- ;The 2002E+ versions of Winbatch have a few new functions for enumerating OLE ;collections. This includes access to all the WMI information on the computer. ;WMI stands for 'Windows Management Instrumentation'. ;Here's the reference from Microsoft: ; ; msdn.microsoft.com/library/en-us/wmisdk/wmi/wmi_start_page.asp?frame=true ; msdn.microsoft.com/library/en-us/wmisdk/wmi/wmi_reference.asp?frame=true ; ; And here are some Winbatch examples: ; ;techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/WMI+!WMI~Reference!.txt ;For details on the Win32_Bios WMI Class, see: ; ; msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_bios.asp?frame=true ; ; ;-------------------------------------------------------------------------------- ; Locator = ObjectOpen("WbemScripting.SWbemLocator") Service = Locator.ConnectServer() Security = Service.Security_ Security.ImpersonationLevel = 3 MemSet = Service.InstancesOf("Win32_LogicalMemoryConfiguration") hEnum = ObjectCollectionOpen(MemSet) While 1 Mem = ObjectCollectionNext(hEnum) If Mem == 0 Then Break TotalPhysicalMemory = Mem.TotalPhysicalMemory TotalVirtualMemory = Mem.TotalVirtualMemory TotalPageFileSpace = Mem.TotalPageFileSpace ObjectClose(Mem) EndWhile ObjectCollectionClose(hEnum) ObjectClose(MemSet) ObjectClose(Security) ObjectClose(Service) ObjectClose(Locator) Message("TotalPhysicalMemory",TotalPhysicalMemory) Message("TotalVirtualMemory", TotalVirtualMemory) Message("TotalPageFileSpace", TotalPageFileSpace) Exit
TotalPageFileSpace Total amount of memory that can be stored in the paging file. This property is no longer supported. You should use the SizeStoredInPagingFiles property in the CIM_OperatingSystem class instead.
Try using this code instead:
Locator = ObjectOpen("WbemScripting.SWbemLocator") Service = Locator.ConnectServer() Security = Service.Security_ Security.ImpersonationLevel = 3 MemSet = Service.InstancesOf("Win32_OperatingSystem") hEnum = ObjectCollectionOpen(MemSet) While 1 Mem = ObjectCollectionNext(hEnum) If Mem == 0 Then Break SizeStoredInPagingFiles = Mem.SizeStoredInPagingFiles ObjectClose(Mem) EndWhile ObjectCollectionClose(hEnum) ObjectClose(MemSet) ObjectClose(Security) ObjectClose(Service) ObjectClose(Locator) Message("SizeStoredInPagingFiles ", SizeStoredInPagingFiles ) Exit
Article ID: W15151
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38