Solved

Batch file asking for folder name?

Posted on 2010-11-25
3
325 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:mpkontor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 95

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 50 total points
ID: 34211923
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
 

Author Comment

by:mpkontor
ID: 34211973
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
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 50 total points
ID: 34212030
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question