Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to create a script, which can be activated through the right-click menu in Windows, which will create a pre-defined folder structure?
Every time we get a new update at my work I have to make a new “update-record” inside a folder. Each update-folder contains exactly the same folders, more or less.

I could create an empty folder structure which I could copy each time but we’re using an older CSV repository and new folders and files have to be created because of some strange reference or ID that it gives it and has trouble separating multiple copies of folders or files.
Another issue is that my Work Laptop is “admin restricted” so I don’t have permissions to install any program, but I can run scripts (just not powershell, unfortunately, because it is not activated) and Macros.

I’m not sure if it is possible at all but it would be a real time-saver just to create a new folder structure with a click of a button.

- Mestika

share|improve this question
Not a direct answer but the fact you've written vbs makes me think you can write vbs so you may be able to do VB? If so, creating a .NET solution for this would be really easy - you can also run it as a stand alone app meaning you don't need to install it. – Dave Aug 14 '12 at 12:20
up vote 2 down vote accepted

Try this bat file (paste the code into notepad and save as a .bat file). The first line is a variable so change it to the root folder you want all to be created.

set rootDirectory = C:\Documents and Settings\username\Desktop\
cd %rootDirectory%
md test
md test\01

The above creates 1 folder on the desktop (called test) and then a subfolder called 01.


In fact you don't even need the variable in this instance either (this does exactly the same, just with 1 line less code):

cd C:\Documents and Settings\username\Desktop\
md test
md test\01
share|improve this answer
Works perfect - thanks.. I just got one follow-up question. Is there anyway to set the RootDirectory to my current Directory / path?? – Mestika Aug 15 '12 at 7:05
Just figure it out :-) Thanks again – Mestika Aug 15 '12 at 7:31
I'm glad it worked for you. – Dave Aug 15 '12 at 7:53
@Mestika : What was it that you figured out, could you please share? – Arjang May 28 '15 at 5:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .