Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

am a newbie in vb.net

i need to achieve a simple task.

just need to create 1500 folders in my D drive and paste the same image file in all the 1500 folders.

how do i achieve it.

What I have tried:

not yet tried as a newbie in VB.NET and this is my task given by organization.
Posted
Updated 23-Jul-16 4:51am
Comments
PIEBALDconsult 12-Jul-16 1:08am    
That seemas like an odd thing to do. What are you trying to accomplish?
Garth J Lancaster 12-Jul-16 1:26am    
In addition to PIEBALDconsult's question, what is the format of the folders ?

Its pretty easy to use

My.Computer.FileSystem.CreateDirectory("Some\Hierarchy");

but what really matters is the 'pattern' / 'hierarchy' of what you're creating - you could end up with (pseudo code)

for i = 0..1499
string dirpath = getNextDirPath(i); // getNextDirPath returns a string representing a path based on the integer i input
My.Computer.FileSystem.CreateDirectory(dirpath)
end-for

if the number from 1 to 1500 was part of the path for example, a simple case
PENNAIAH NAGARAJAPPA 12-Jul-16 1:57am    
Hey guys thanks for the reply.. just want to make you guys clear about it.. its a requirement for some different team in my organization.. am good at (VBA) and newbie in vb.net.. so seeking some help.. i just need to create 1500 folders in my "D:\" as sample 1 , sample 2 , sample 3 and goes on.. and i have PDF in my desktop "mypdf" and i need to copy this pdf file to all the 1500 folders i have created.
Tomas Takac 12-Jul-16 3:16am    
Always use "reply" when replying to a comment otherwise people don't get notified.
Tomas Takac 12-Jul-16 3:15am    
It's a for-loop with call to Directory.CreateDirectory method[^] inside. What exactly is your problem?

1 solution

Dim i As Integer

For i = 1 To 1500
IO.Directory.CreateDirectory("d:\foldername" & i)
Next
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900