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

Set colPageFiles = objWMIService.ExecQuery _
("Select * from Win32_PageFileSetting")

For Each objPageFile in colPageFiles
objPageFile.InitialSize = 0
objPageFile.MaximumSize = 0
objPageFile.Put_
Next

Setting both the InitialSize and MaxSize to 0 lets windows manage the swap file. I figured this out by trying it out HURRAY