Batch file help please with if exist <p>We have this printer management software that comes with built-in backup/restore command to backup its database. </p> <p>And I need to create a batch file that will:</p> <p>1a. check if folder name <code>OLD</code> exist on <code>C:\mybackup\</code> </p> <p>1b. if it does then remove the folder and the contents, then </p> <p>2a. check if <code>C:\mybackup\*.bak</code> exist </p> <p>2b. if it does then create a folder called <code>OLD</code> in <code>C:\mybackup\</code> </p> <p>2c. then move <code>C:\mybackup\*.bak</code> to <code>C:\mybackup\OLD</code> </p> <p>then run backup command which creates multiple <code>.bak</code> files on <code>C:\mybackup\</code></p> <ol start="3"> <li><code>scBackup64.exe -b C:\mybackup\</code> exit</li> </ol> <p>I can only think of the commands, I wonder how to wrap it up with <code>IF THEN ELSE</code> or <code>IF EXIST</code></p> <pre><code>@echo off RD /S /Q C:\mybackup\OLD MKDIR C:\mybackup\OLD MOVE /Y C:\mybackup\*.bak C:\mybackup\OLD scBackup64.exe -b C:\mybackup\ </code></pre>