Re: creating folder tree structures



Sweet! Very helpful, thanks. I wasn't understanding how to do the
subfolders, and I see now that it is very simple. I was searching and
searching through the scripting guy for something simple, but your
snippet is perfect.

When I have a working script (with the while statement) I will post
here in case someone else needs something similar.

John

bob m wrote:
if the child folders will always be the same, and you just need to set the
root, you could do this:

Dim fso, strRoot
Set fso = CreateObject("Scripting.FileSystemObject")
strRoot = InputBox("Enter full path to create root folder")
fso.createFolder(strRoot)
fso.createFolder(strRoot & "\subfolder1")
fso.createFolder(strRoot & "\subfolder2")
fso.createFolder(strRoot & "\subfolder1\insidesubfolder1")
Set fso = Nothing

get the idea? run this, enter C:\test as the root, and the rest is created
on its own





"John Lockie" <john.lockie@xxxxxxxxx> wrote in message
news:1163104792.586982.47720@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ok, that's a start.

Well, I think I know what I want to do.

I want to first create the most basic vbs that will create folders like
this (from scratch)
- FOLDER 1 <--- input box used here only to get folder name, all
others set
- SUBFOLDER A
- SUBFOLDER B
- SUBFOLDER i
- SUBFOLDER C
- SUBFOLDER D

and so on.....

Then, once I have that part working, I would like to add the
strFolderName = Inputbox element. So that ONLY "Folder 1" name is
required, the rest of the subfolders are set already. So then, in
theory I only need my script to run 1 process of creating the folders,
over and over again, until the user has finished, then somehow I need
to end the script.

So is that possible? To somehow add a "while" statement, where the
user can continue the process, and then when they are done they can hit
a second button besides "OK" to finish the script?

bob m wrote:
strFolderName = Inputbox("Enter folder name")



"John Lockie" <john.lockie@xxxxxxxxx> wrote in message
news:1163090201.082824.38100@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

Thanks for taking the time to read this.

I work in the construction industry. We have recently started a new
policy for how our project managers and department heads are supposed
to digitally file job documents.

This means that each time we start a new job or new project a
particular folder structure is setup in our file servers. I am talking
100+ folders a week, each containing about 10 subfolders, and even some
subfolders below those. As you can figure, this is a tedious task for
anyone to do. I am looking to streamline this using some VB script if
it's possible.

The problem I am running into is that I still have to copy/paste folder
names into my script (either script or simple mkdir batch file).

I wanted to ask if there is a way to build a prompt using VB script so
that if asks for the folder name and then does it's thing. This would
be good so that I can create a small program for others to use.

That, or can I inject data into my script from an outside database?

This script will be more complicated, so that is why I am here asking.
I know this is possible, and I think I should get this setup as it's
going to make a big difference to our daily operations....

Thanks,
John L



.