I'm running the following as a part of chef deployment of a windows server.

cscript /nologo C:\chef\wget.vbs /url:http://www.opscode.com/chef/install.msi /path:C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi 

The error I get is:

CScript Error: Execution of the Windows Script Host failed. (0x800A0007)

The vbs file is created by this command:

 echo.url = WScript.Arguments.Named("url")  
 echo.path = WScript.Arguments.Named("path")  
 echo.proxy = null  
 echo.Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")  
 echo.Set wshShell = CreateObject( "WScript.Shell" )  
 echo.Set objUserVariables = wshShell.Environment("USER")  
 echo.'http proxy is optional  
 echo.'attempt to read from HTTP_PROXY env var first  
 echo.On Error Resume Next  
 echo.If NOT (objUserVariables("HTTP_PROXY") = "") Then   
 echo.proxy = objUserVariables("HTTP_PROXY")  
 echo.'fall back to named arg  
 echo.ElseIf NOT (WScript.Arguments.Named("proxy") = "") Then   
 echo.proxy = WScript.Arguments.Named("proxy")  
 echo.End If  
 echo.If NOT isNull(proxy) Then  
 echo.'setProxy method is only available on ServerXMLHTTP 6.0+  
 echo.Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")  
 echo.objXMLHTTP.setProxy 2, proxy  
 echo.End If  
 echo.On Error Goto 0  
 echo.objXMLHTTP.open "GET", url, false   
 echo.If objXMLHTTP.Status = 200 Then   
 echo.Set objADOStream = CreateObject("ADODB.Stream")  
 echo.objADOStream.Type = 1  
 echo.objADOStream.Write objXMLHTTP.ResponseBody  
 echo.objADOStream.Position = 0  
 echo.Set objFSO = Createobject("Scripting.FileSystemObject")  
 echo.If objFSO.Fileexists(path) Then objFSO.DeleteFile path  
 echo.Set objFSO = Nothing  
 echo.objADOStream.SaveToFile path  
 echo.Set objADOStream = Nothing  
 echo.End if  
 echo.Set objXMLHTTP = Nothing                                                                                                                                       
) 1>C:\chef\wget.vb

If I rdp into the server and run the same first command it works successfully.


I found a pull request for this had been merged into the knife-windows gem but wasn't in the released gem yet. I fixed my issue by installing the specific_install gem and using that to install from the source on github.

gem install specific_install
gem specific_install -l https://github.com/opscode/knife-windows.git
  • Had to do gem install specific_install instead of specific_installer. – kjw0188 Jan 25 '13 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.