Use the for /f
command to loop through all users in C:\Users
, then check if the file exists in each users Desktop
directory - if it does, delete the file.
for /f %%a in ('dir /B /AD C:\Users') do (
if exist "C:\Users\%%a\Desktop\Kronos Workforce Central(R).url" del /F /Q "C:\Users\%%a\Desktop\Kronos Workforce Central(R).url"
if exist "C:\Users\%%a\Desktop\Kronos Workforce Central(R).website" del /F /Q "C:\Users\%%a\Desktop\Kronos Workforce Central(R).website"
)