I have the following line:
for %i in (bin\Setup) do if not %i == setup.exe del %i
This for pretends to delete all files in bin\Setup
except from the one called setup.exe, but it's not working...
Any ideas on what I'm doing wrong?
I have the following line:
for %i in (bin\Setup) do if not %i == setup.exe del %i
This for pretends to delete all files in bin\Setup
except from the one called setup.exe, but it's not working...
Any ideas on what I'm doing wrong?
Copyright © 2021 Jogjafile Inc.
Changes made:
if
is now case insensitive (/i
)%~nxi
) is tested. You can executefor /?
to retrieve a full list of modifiers available.%~fi
) to itThis is written to be executed from command line. Inside a batch file the percent signs need to be escaped, replacing
%
with%%
del
commands are prefixed with aecho
so files are not removed, the command is just echoed to console. If the output is correct, remove theecho
.