- Batch if then
- Posted by joshboski on June 5th, 2008
I need to some how check these drives and delete files off of them but
somehow it will not skip N which is a drive I do not want to delete
from
<quote/>
@echo off
FOR /F "tokens=1,2 delims=\ " %%A IN ('FSUTIL FSINFO DRIVES ^| MORE /
E /T0') DO (
REM Skip N:
IF "%%A"=="N" (
echo "skipping N"
) else (
echo "Deleting files from %%A"
del /S "%%A%\FILE1"
)
)
</quote>
- Posted by Pegasus \(MVP\) on June 5th, 2008
"joshboski" <josh.burkholder@gmail.com> wrote in message
news:0f58fd33-8124-4975-9451-7f893e589cf9@m45g2000hsb.googlegroups.com...
Replacing
IF "%%A"=="N" ( with
IF "%%A"=="N:" (
might help . . .
Having "@echo on" as the first line will make this type
of error glaringly obvious.
Similar Posts
- calling multiple batch files from within a batch file (Microsoft Windows) by yawnmoth
- Batch file works in command line but not as a batch (Microsoft Windows) by Danger
- Batch by Benny Pedersen (A batch file for your systems supporter) ... (MS-DOS) by Benny Pedersen
- non functional command when batch calls a batch (Windows XP) by jonefer
- Photo Editor Batch supporting batch compression JPG files (Software & Applications) by 29150

