Saturday 15 February 2014

http - Downloading a folder in VBS -


I want to download a folder or personal file, but the way I am downloading files does not know the file name This is the reason why I want to download the folder, then I can save the folder to write more or add additional file to the output folder. For personal files I am setting args = wScript.Arguments obsolete ("wscript.Network") url = "http://webpage.com/downloads" dim xHttp : Set XHttp = createobject ("Microsoft.XMLHTTP") Dims bStrm: set bStrm = createobject ("Adodb.Stream") xHttp.Open "GET", URL, False xHttp. Send with BStrm. Type = 1 '// binary open. Write XHttp.responseBody .savetofile "C: \ users \" and objNetwork.UserName and "\ AppData \ roaming \ downloadfolderarea", overwrite 2 '//.

Appreciate with any help

XMLHttpRequest Objects do not support FTP or SSH. You will need to use the appropriate client for those protocols, e.g. (For SSH / SCP / SFTP) ftp.exe (for FTP) or tools I prefer, because you use public key authentication instead of dealing with username / password can do.

The above customers are scripts and you can execute them with VBSSP using the method. For example plink :

  set sh = CreateObject ("WScript.Shell") sh.Run "C: \ path \ to \ pscp.exe -i key User @ host: / path / to / src C: \ dst "   

No comments:

Post a Comment