I have a feeling you just moved the goal posts, as we say in soccer countries.
Is this the string you wish to find and remove?
[WwW.LoKoTorrents.CoM]
Or is it this (as you originally stated)?
[www.lokotorrents.com]
because there is a difference. As you should be able to see. Which might explain why my code "didn't work".
And why, if I am right, you will need to change this line:
for /f "delims==" %%F in ('dir /b ^| find "%deletestring%"') do (
to this:
for /f "delims==" %%F in ('dir /b /l ^| find "%deletestring%"') do (
The /l switch for DIR forces the file listing to be all lower case.
And the answer to this question
Does this code only work on files with the extension .nul? By the looks of it, it works on all file types.
is: No, it doesn't only work on files with the extension .nul, and you are right, it works on all file types. If you wanted to restrict it to only certain file types, you could modify the FOR command line like this. Let's say you only want to rename .nul files...
for /f "delims==" %%F in ('dir /b /l *.nul ^| find "%deletestring%"') do (