title: Out of memory error in vbs scripts
body: <p>I've been facing this dialogue box just after I start my script</p>
  
  <pre><code>Script: C:\konica.vbs
  Line: 14
  Char: 1
  Error: Out of Memory: 'GetObject'
  Code: 800A0007
  Source: Microsoft VBScript runtime error
  </code></pre>
  
  <p>This is my script:</p>
  
  <pre><code>Set wshShell = CreateObject("WScript.Shell")
  strCurrDir = Replace(WScript.ScriptFullName, WScript.ScriptName, "")
  
  
  '### Konica ###
  
  strIPAddress = "192.168.110.168"
  strComputer = "."
  strPrinterName = "Konica"
  strDriverName = "KONICA MINOLTA C353 Series PS"
  strLocation = "Konica"
  strInfFile = "\\stp\HHard\Printers\KONICA MINOLTA\XP(x86)\BHC353PSWinx86_6500RU\BHC353PSWinx86_6500RU\KOAZXA__.INF"
  
  Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(LoadDriver)}!\\" &amp; strComputer &amp; "\root\cimv2")
  Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer Where PortName = 'IP_" &amp; strIPAddress &amp; "' ")
  For Each objPrinter in colPrinters
      MsgBox "Unable to install printer, printer already found on port 'IP_" &amp; strIPAddress &amp; "'." &amp; VbCrlf &amp; VbCrlf &amp; "Found:  " &amp; objPrinter.DeviceID, vbExclamation + vbSystemModal, "Printer Port already assigned"
      WSCript.Quit 114001
  Next
  'MsgBox(strIPAddress)
  Set objNewPort = objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_
  objNewPort.Name = "IP_" &amp; strIPAddress
  objNewPort.Protocol = 1
  objNewPort.HostAddress = strIPAddress
  objNewPort.PortNumber = "9100"
  objNewPort.SNMPEnabled = False
  objNewPort.Put_
  
  wshShell.Run "rundll32 printui.dll,PrintUIEntry /if /b """ &amp; strPrinterName &amp; """ /f """ &amp; strInfFile &amp; """ /r ""IP_" &amp; strIPAddress &amp; """ /m """ &amp; strDriverName &amp; """", 1, True
  
  Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer Where DeviceID = '" &amp; strPrinterName &amp; "' ")
  For Each objPrinter in colPrinters
      objPrinter.Location = strLocation
      objPrinter.Put_
  Next
  </code></pre>
  
  <p>You can see, that it script for installing in my system printer 'Konica'. In other system, it script works fine. Where mistake? Please help ?</p>