Need some help coding this in BAT.
The script is written so that it does a recursive search with WMI to delete specific files on the the fixed drives.
I would like to know how to make it so that it has logic like the following, I just can't seem to figure this out in this script
IF folder above "fileName0.url" == blue && AND && fileName == fileName0.url
Then Delete file fileName0.url
else if - ignore
What I has so far, anyone have any ideas or have code to add to make it perform like the logic above
@echo off
Title Search and Delete Specific File
::Find out what disks are on the system.
for /f "usebackq skip=1 tokens=1" %%a in (`wmic logicaldisk get deviceid`) do (
::Make sure we only use the fixed disks
for /f "usebackq tokens=2 delims=:- " %%x in (`fsutil fsinfo drivetype %%a`) do (
::Is %%a, a fixed disk?
if "%%x" == "Fixed" (
echo.
echo - - - - - - - - - - - - - - - - - - - - - - - - -
echo Searching drive %%a for Startup Shortcuts
del /s/f/q "%%a\fileName0.url"
del /s/f/q "%%a\fileName1.url"
)
)
)
)