I am looking for a VB script or batch file to read & Execute multiple URLs from an CSV file containing the URL Data in column B & The mentioned URL directly contains on the downloadable file which need to store at location or directory named on behalf of content stored in Column A.
Column A & Column B could be vice versa.
I was trying same thing with batch file but unable to read CSV file automatically instead able to create simple code as show below but would be no success for daily usage as automatic as always required manual intervention, please help accordingly, also check in Python solution code is available but do not want to use it as required Python installation as do not want to do so too.
@echo Off
TITLE Test File Download and Storage
Pause
CD\
d:
cd Test
dir Tes_poc1 [i.e. From column A]
curl http://www.abcd,com/file1.pdf > file1.pdf [URL Just for example, can't share actual one due to security limitations]
cd Test
dir Tes_poc2 "i.e. From column A"
curl http://www.abcd,com/file2.pdf > file2.pdf [URL Just for example, can't share actual one due to security limitations]
Edit :
Also tried following VBscript able to download file and create folder but unable to move downloaded file to respective folder:
dim objFileSys, objReadFile
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const csFSpec = "1.txt"
Dim goFS : Set goFS = CreateObject("Scripting.FileSystemObject")
Dim goWS : Set goWS = CreateObject("WScript.Shell")
Dim tsIn : Set tsIn = goFS.OpenTextFile(csFSpec)
Do Until tsIn.AtEndOfStream
Dim sLine : sLine = tsIn.ReadLine
goWS.Run """chrome.exe"" """ & sLine & """", 1, True
Loop
tsIn.Close
Set objFileSys = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFileSys.OpenTextFile("D:\Test\2.txt", ForReading)
Do until objReadFile.AtEndOfStream = True
objFileSys.CreateFolder(objReadFile.ReadLine)
Loop
objReadFile.Close
Set objReadFile = Nothing
Set objFileSys = Nothing
Where 1.txt contains list of urls and 2.txt contains list of respective URL folder name to be create
here are few Example URL's you can use as sample. http://www.iiswc.org/iiswc2009/sample.doc
https://www.scc.kit.edu/downloads/jrg-mb/Abstract_template.doc
https://www.k-state.edu/grad/etdr/template/mastersinstructions.doc
Suppose you have the contents of the.csv file like this one in the same folder of your batch file : Test.csv
You can do something like this to download files with Certutil command line :