title: VBS using LIKE to compare strings "Sub or Function not defined"
body: <p>I'm trying to make a script to connect a network printer to a user computer. 
  The script uses the computer name who needs the printer as a parameter.</p>
  
  <p>Printers names are similar their printserver name, eg. server_USA has printers like printer_USA01, printer_USA02.</p>
  
  <p>But it's throwing the error "Sub or Function not defined" when arrives at the first like... why ?</p>
  
  <pre><code>Set shl = WScript.CreateObject("WScript.Shell")
  strName = Wscript.Arguments.Item(0)
  
  'input Printer name
  strPrinter = InputBox("Please enter share name of printer to install:", _
      "Add network printer")
  
  if strPrinter = "" then
      msgbox "Can't be empty."
      WScript.quit
  
  elseif strPrinter Like "printer_USA*" then
      strServer = server_USA
  
  elseif strPrinter Like "printer_SPAIN*" then
      strServer = server_SPAIN
  
  else
      'Printer name NOT registered, input printserver manually:
      strServer = inputbox("Please enter the name of the printserver","printserver")
  
      if strServer = "" then
          msgbox "Can't be empty."
          WScript.quit
      End if
  
  End if
  
  'ADD
  shl.run "RUNDLL32 PRINTUI.DLL,PrintUIEntry /ga /c\\" &amp; strName &amp; " /n\\" &amp; strServer &amp; "\" &amp; strPrinter
  </code></pre>