Trying to automate directory structure creation with a batch file

By sin76 ·
I would like to set it up so I can enable users on a windows network to create a directory structure "on-demand" via a batch script that could be triggered from a shortcut (or a "favorites" link in Windows explorer"). Or some similar fashion.

I know how to make the script to create the directories in the same folder as the batch script, but what I'm thinking is I'd like to put the batch script on a shared drive and let users on the network navigate to any directory on their machine and with one click of a shortcut to the batch file have the directory structure created for them in whatever directory they happen to be in (in windows explorer).

Currently the way I'm doing it the shortcut makes the batch script create the directory structure only in the same directory where the batch script resides. Not very helpful to me. I obviously missing the part that tells it WHERE to create the folders.

If anyone can help me out with this batch script It would be much appreciated.

I'm not familiar with vbscript but would consider it if it gets the job done.

Thank you in advance for any help.


- I don't want them to have to copy the script from one location and into the directory they want the structure created.

- The Folder structure consists of a few folders and some subfolders. Example below.

folder1 -


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

%1 is your friend.

by seanferd In reply to Trying to automate direct ...

This may be more effective from a context menu as well.

[HKEY_CLASSES_ROOT\Directory\shell\<i>name your key</i&gt
@="<i>menu display name</i>"

[HKEY_CLASSES_ROOT\Directory\shell\<i>name your key</i>\Command]
@="Cmd.exe /c cd \"%1\"" <i>insert your script call</i>

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\<i>name your key</i&gt
@="<i>menu display name</i>"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\<i>name your key</i>\Command]
@="Cmd.exe /c cd \"%1\"" <i>insert your script call</i>

Related Discussions

Related Forums