0

I'm made this simple batch script that reads devices line by line from Device_List file and for each device delete some folders using Windows samba shared folder.

@ECHO OFF
for /f "delims=" %%a in (C:\Device_List.txt) do (
set computer=%%a
SET path=\\%computer%\c$\Dir_to_delete
DEL %path%\* /s /f /q
)

If I run program I take \Overlook was unexpected at this time error. Issue seems related to for cycle, since if I remove it, other commands works as expected. Anyone can help me?

  • 3
    Please do yourself a favor and don't mess with the `%path%` variable. It tells Windows where to find its executables. Choose another variable name. – Stephan Mar 02 '21 at 18:39
  • Thank you very much I've solved thanks your suggestions. Thank you again – Marco Novelli Mar 02 '21 at 19:00

0 Answers0