&& not with psexec and FOR comman RRS feed

  • Question

  • I have this simple one-line code to remove all users InspectionManager Folder from %localappdata%

    psexec \\%pctag% cmd.exe /c For /f "tokens=5 delims= " %%G in ('dir c:\users') do rmdir "C:\Users\%%G\AppData\Local\Temp\InspectionManager" && echo Remove

    All the InspectionMananger Folders are removed for all the users.

    However, nothing will echo - even though the folders are removed.

    I have tried with & echo Remove and || echo Remove and still nothing will echo

    I have tried with delayedexpansion enabled\disabled still nothing will echo

    Note: even though the folder gets removed, I get a path not found error which may be causing the issue

    Saturday, February 9, 2019 8:54 PM