Question

Locked

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
-----------

Folder1
Folder2
Folder3
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
Loop

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Go back to the XP computer & open that .csv file

by Absolutely In reply to creating folders using vb ...

insert a column before it. Type the 'mkdir' command at the top of that column.
Copy to bottom.
Save as TEXT; select space delimited.
Open the text file on the server.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true
Make it a batch file.

Back to Networks Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums