Computing.Net > Forums > Windows XP > Creating a folder using a batchfile

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Creating a folder using a batchfile

Reply to Message Icon

Name: talksr
Date: December 16, 2008 at 00:27:16 Pacific
OS: XP Professional
CPU/Ram: 1gb
Product: Dell dimension / D600
Comment:

Hello,
I want to make a batch file which will create a new folder in the C drive called TEMP (C:\Temp) but I need the script to firstly check to see if the Temp file is already there, and if it is, it mustn’t overwrite it.

Any ideas?




Sponsored Link
Ads by Google

Response Number 1
Name: Wahine
Date: December 16, 2008 at 00:51:54 Pacific
Reply:

IF EXIST C:\TEMP\ GOTO END
MD C:\TEMP
{other code...}

:END
ECHO C:\TEMP FOLDER ALREADY EXISTS


0

Response Number 2
Name: Mechanix2Go
Date: December 16, 2008 at 03:09:05 Pacific
Reply:

MD C:\TEMP

Will create it if it doesn't exist. If it does, you get an error.


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 3
Name: talksr
Date: December 16, 2008 at 08:04:32 Pacific
Reply:

Thanks for your comments, both were very useful.

Have a good Christmas.


0

Response Number 4
Name: tvc
Date: December 23, 2008 at 09:44:25 Pacific
Reply:

if not exist C:\temp\nul mkdir C:\temp

... will not give any error output


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Creating a folder using a batchfile

Open folder using batch file www.computing.net/answers/windows-xp/open-folder-using-batch-file/180554.html

Can create a folder in Windows Expl www.computing.net/answers/windows-xp/can-create-a-folder-in-windows-expl/165077.html

Create a Windows Rescue CD www.computing.net/answers/windows-xp/create-a-windows-rescue-cd/105883.html