RogueSpear Posted September 22, 2004 Share Posted September 22, 2004 I hope someone finds this useful. I wrote a subroutine in VBscript to set the page file. It creates a page file that is twice the amount of RAM in your system.'**********************************************************************'** Subroutine; Page File configuration **'**********************************************************************Sub ConfigPageFile Dim strComputer, objWMIService, objSWbemServices, colPageFile, colSWbemObjectSet Dim objSWbemObject, SystemRAM, objPageFile strComputer = "." Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objSWbemServices = GetObject("winmgmts:\\" & strComputer) Set colPageFile = objWMIService.ExecQuery ("SELECT * FROM Win32_PageFileSetting") Set colSWbemObjectSet = objSWbemServices.InstancesOf("Win32_LogicalMemoryConfiguration") For Each objSWbemObject In colSWbemObjectSet SystemRAM = objSWbemObject.TotalPhysicalMemory / 1000 Next For Each objPageFile In colPageFile objPageFile.InitialSize = 2 * SystemRAM objPageFile.MaximumSize = 2 * SystemRAM objPageFile.Put_ NextEnd Sub Link to comment Share on other sites More sharing options...
RyanVM Posted September 22, 2004 Share Posted September 22, 2004 Maybe I'm off base here, but wouldn't it beSystemRAM = objSWbemObject.TotalPhysicalMemory / 1024??? Link to comment Share on other sites More sharing options...
RogueSpear Posted September 22, 2004 Author Share Posted September 22, 2004 Indeed, it would be. I guess it was one of those "fine tuning" things I forgot to get back to... for two years Link to comment Share on other sites More sharing options...
Anderz Posted September 22, 2004 Share Posted September 22, 2004 Swell! This one is indeed needed! Good job ... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now