HELP Simple IF File Moving!!!

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
blksith0
Posts: 1
Joined: 10 Mar 2011 20:52

HELP Simple IF File Moving!!!

#1 Post by blksith0 » 10 Mar 2011 21:06

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)

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

Re: HELP Simple IF File Moving!!!

#2 Post by avery_larry » 11 Mar 2011 10:59

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?

Post Reply