Solved

Batch file asking for folder name?

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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