Creating subdirectories with MkDir

P

Phosphor

Can I make subdirectories only in a path already established. I have tested making new directories and nested directories...however when I try to add subdirectories I get a run-time error.
 
M

Media Lint

Which shouldn't be a problem at all. Use the Dir function
to verify if the first level folder exists, if not make
it, then go on to the sublevel

This work splendidly in this order:

MkDir "C:\MyFolder"
MkDir "C:\MyFolder\SubFolder1"
MkDir "C:\MyFolder\SubFolder1\data"
-----Original Message-----
Can I make subdirectories only in a path already
established. I have tested making new directories and
nested directories...however when I try to add
subdirectories I get a run-time error.
 
P

Phosphor

I get it now... You only make the first path and then you Dir the rest except the last bit of path

Dir "C:\TestFolder4"
Dir "C:\TestFolder4\Folder3"
MkDir "C:\TestFolder4\Folder3\Folder6"

I tried this and it worked.

----- Media Lint wrote: -----

Which shouldn't be a problem at all. Use the Dir function
to verify if the first level folder exists, if not make
it, then go on to the sublevel

This work splendidly in this order:

MkDir "C:\MyFolder"
MkDir "C:\MyFolder\SubFolder1"
MkDir "C:\MyFolder\SubFolder1\data"
-----Original Message-----
Can I make subdirectories only in a path already
established. I have tested making new directories and
nested directories...however when I try to add
subdirectories I get a run-time error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top