Solved

Batch file asking for folder name?

Posted on 2010-11-25
3
293 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now