1.

Solve : Create directory if not already existing?

Answer»

Hi,

I have a newbiee question I guess. I would like to create a directory using a bat file. If the directory already exists I dont whant to do it. Something líke this.

rem Create directory
md ..\results

rem copy log file to results directory
cp file.txt ..\results\file.txt

The thing is that I run my bat file multiple TIME so I get a warning that says that the folder already exists. This only works the first time I run the script. I am running the bat file in XP.

Is there some way to do skip the creation if the folder already exists?What Operating System is this?Quote from: Carbon Dudeoxide on AUGUST 29, 2007, 04:00:48 AM

What Operating System is this?

Read the post, dude!

Quote
I am running the bat file in XP.

The answer is...

To be found on Google.




Quote from: contrex on August 29, 2007, 04:50:15 AM
Quote from: Carbon Dudeoxide on August 29, 2007, 04:00:48 AM
What Operating System is this?

Read the post, dude!

« Last Edit: Today at 06:08:43 PM by di98mase »

Must of edited it then. Last Edit: Today at 11:08:43 AM by di98mase
Reply #1 on: Today at 11:00:48 AM by Dudeoxide

Now I call that DOWNRIGHT sneaky. I'll edit my answer now I've SEEN that.

Quote from: di98mase on August 29, 2007, 03:53:28 AM
...
Is there some way to do skip the creation if the folder already exists?

Have a look here . Experiment a bit, and let us know if that HELPED.




Discussion

No Comment Found