creating folders using vbs from csv

By atucakovic ·
I have a more complex need that i can resolve in vbs if i could figure out how to create script to create folders that are listed in a csv. I can do it from excel but can seem to figure out csv and installing excel just to be able to run my script on a server is really not an option.

folder.csv would look some thing like this when opened

and so on

i cant seem to find a way to get vbs to read line by line and excecute a command after every line
my excel way would be like this i am looking for csv way though

Set objWorkbook = objExcel.Workbooks.Open("C:\script\temp2.xls")
'bind to the worksheet one
Set objWorksheet = objWorkbook.Worksheets(1)

i = 1
'go line by line in column A and excecute whatever is needed strName will be whatever is in the filed at that row

Do Until objExcel.Cells(i, 1).Value = ""
strName = objExcel.Cells(i, 1).Value

'bellow place your function or what you want the script to do with current strName value

'oFSO.CreateFolder("C:\home\" & strName)
'this will create folder for every row named as the filed in excel

i = i + 1

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Related Discussions

Related Forums