Batch file asking for folder name?

Hi,

I need to create a batch file that creates a new folder located on ex. \\192.168.1.X\Folder\Customer\"New folder here"

It should ask for name, and afterwards create the folder.
Itøs probably simple, but i'm not good with programming.

BR /Klaus
mpkontorAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
You should always put paths in quotation marks - when it's not needed it won't matter and when it is needed, you won't have a problem.  Note - the ENTIRE path - not just a part:

GOOD:
MD "\\192.168.1.x\share\folder\customer\%Folder%"

BAD:
MD \\192.168.1.x\share\folder\customer\"%Folder%"
0
 
Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
You prompt with
SET /P Variable=Prompt for input

You then reference the input with %Variable%.

For example:

Set /P Folder=Enter a Folder Name
MD \\192.168.1.x\share\folder\customer\%Folder%
0
 
mpkontorAuthor Commented:
I have one problem... One of the folders is called "D Customers" . So it just creates a folder called D and stops...???

Do I need to put it in qutaionmarks??
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.