| 1. |
Solve : IF NOT EXIST? |
|
Answer» okay so what if I wanted to make a code for a batch FILE that WOULD delete a certain folder or folders if a certain file doesnt exist. I have tried in a DOS command window and found the commands that work for this, but when i compile this into a batchfile code it does not works. This is what I have: IF NOT EXIST key.txt In batch language you cannot WRITE multiline IF statements like that. The whole statement MUST be on one line, either an actual line or an extended line. On one actual line... Quote IF NOT EXIST key.txt DEL test.txt Or on an extended line. A line is extended with an open-parentheses character "(" and the extension is finished with a close-parentheses character ")". Quote IF NOT EXIST key.txt ( This works at the command line too, in win2K and XP Quote c:\>( Note: These are parentheses ( ). These are "brackets" { }. |
|