title: How to Run VBS script from cmd?
body: <p>I have the following vbs script from <a href="http://support.microsoft.com/kb/280290" rel="nofollow noreferrer">Microsoft Support</a> for adding Excel add-in:</p>
  
  <pre><code>Dim oXL As Object
  Dim oAddin As Object
  Set oXL = CreateObject("Excel.Application")
  oXL.Workbooks.Add
  Set oAddin = oXL.AddIns.Add("c:\Program Files\MyApp\MyAddin.xla",  True)
  oAddin.Installed = True
  oXL.Quit
  Set oXL = Nothing
  </code></pre>
  
  <p>I save the above script to a file called as addin.vbs and run it from a command console:</p>
  
  <pre><code>C:\...&gt;cscript addin.vbs
  </code></pre>
  
  <p>I got the following error:</p>
  
  <pre><code>c:\...\addin.vbs(1, 9) Microsoft VBScript compilation error: Expected end of statement
  </code></pre>
  
  <p>Not sure how I can run it from cmd console?</p>
  
  <p>I am running it from Windows XP.</p>