I'm trying to scan files in directorys for text inside, but whenever I come across a file that has the ' - Copy' added to the end of it from windows, the program will not read it. I've tried using quotes within the name being passed, but no dice.
FOR /R %%F in (*.CDP) do (
for /f "tokens=*" %%a in (%%~nxF) do (
I've been using this code and have no issues with the typical files Im seeing. however if its something like dummy_file - Copy, I will get an error from the program saying 'System cannot find the file dummy_file.' period included. If I use
FOR /R %%F in (*.CDP) do (
for /f "tokens=*" %%a in ("%%~nxF") do (
Then the second for loop gets skipped, and the program proceeds on. I thought this would made the loop take it as a string literal, but apparently the for loop has its own way of reading things.
Is it possible to accept files in this loop that have a - Copy in them? Will I be able to use dummy_file - Copy.cdp here?
Aucun commentaire:
Enregistrer un commentaire