Code: Select all
@echo off
for /F "skip=1" %%D in ('wmic logicaldisk get caption') do (
cd /D %%D
del /AH /S /Q ~$*.xlsm
)
pause
which shows both that it does work but also is unable to access some folders [or maybe just files?] on volume ZCould Not Find X:\~$*.xlsm
Deleted file - Y:\TEST1\~$some test file.xlsm
Deleted file - Z:\TEST2\~$another test file.xlsm
The filename, directory name, or volume label syntax is incorrect.
Could Not Find Z:\~$*.xlsm
Is there a way to pn point this erroneous path? How to make the CMD window write where exactly it failed at accessing?