Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
silent
- Posts: 44
- Joined: 28 Oct 2011 14:40
#1
Post
by silent » 24 Mar 2012 11:09
Hi,im on second level of my game,and i need to check if 3 files exist,and if they exist the program has to delete them and has to make a new one.
I have tried this :
Code: Select all
if exist "name1" &if exist "name2" &if exist "name3" del "name1" &del "name2" &del "name3" &echo s > file.txt
The program just closes itself.
Ive also tried this :
Code: Select all
if exist "name1","name2" (..) del "name1",(..) &echo s > file.txt
It also failed...
-
!k
- Expert
- Posts: 378
- Joined: 17 Oct 2009 08:30
- Location: Russia
#2
Post
by !k » 24 Mar 2012 11:14
Code: Select all
if exist "name1" if exist "name2" if exist "name3" (del "name1" "name2" "name3" &echo s > file.txt)