Page 1 of 1

HELP Simple IF File Moving!!!

Posted: 10 Mar 2011 21:06
by blksith0
I have a file in folderone/sub1 called Hello.txt
Now lets say I want a script to delete that file out, and the same script will also copy another file in in, if its not there.

So I can do
IF EXIST folderone/sub1/Hello.txt GOTO :!
:1 del folderone/sub1/hello.txt
exit

But now what do I do, thats the part that gets rid of it. Now how do I make it check if its there, and then copy the other file in?
(The other file is the same file but its in another location, its there to be copied in)

Re: HELP Simple IF File Moving!!!

Posted: 11 Mar 2011 10:59
by avery_larry
SO --

I'm not clear on when you want to copy the other file . . ?

IF hello.txt exists, then delete it and do nothing else? Or delete it and then copy the other file?


IF hello.txt does not exist, then copy the other file?