• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About jwall

Profile Information

  • OS
    none specified
  1. I'm not so worried about the restart but more concerned with deleting the page file. I know if we go to System Properties > Advanced tab > Performance settings > Advanced > Change, enable "No paging file" pagefile.sys gets deleted. I figure if there's a way to set the size of the page file there is a way to delete it.
  2. Thanks for the code. I get the "Sharing violation" popup, which makes sense because pagefile.sys is in use, and then an error on line 46 of "Privilege not held". I'm sure the code to set no paging file is in C:\WINDOWS\system32\pagefileconfig.vbs andI've tried to find it but the script is so modularized I can't nail it down.
  3. I know how to set the size of the page file using vbs but I need to disable it altogether (ie set it to "No paging file" on an XP machine. I know it can be done with C:\WINDOWS\system32\pagefileconfig.vbs but I want to write it into a script I'm working on. To be more specific, I need one script that will disable it, then after rebooting I want to run another script that will set the min and max, the code I have for that is: Sub SetPF () Dim strComputer,oWMIService,colCSItems,oCSItem,colPageFiles,strRAMCount,oPageFile strComputer = "." Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colCSItems = oWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem") Set colPageFiles = oWMIService.ExecQuery ("Select * from Win32_PageFileSetting") ' Get the amount of installed physical memory For Each oCSItem In colCSItems strRAMCount = oCSItem.TotalPhysicalMemory / 1048576 Next ' Set the Min and Max page file size For Each oPageFile in colPageFiles oPageFile.InitialSize = Round(strRAMCount) oPageFile.MaximumSize = Round(strRAMCount * 1.5) oPageFile.Put_ Next End Sub And this works, but I just ran a test using C:\WINDOWS\system32\pagefileconfig.vbs to delete the pf first and the script above does not enable it again so I need to add some code to it.