I have a command line script I’m testing to search an entire directory for a given file (e.g. cmd.exe). This script is working well and returns the full path to each found file.
for /r C:\ %i in (*) do @echo %~fi | find /I "cmd.exe"
Now I would like to expand on this script and once a file is found check the permissions (e.g. icacls %~fi). I would like to keep this to a one-liner on the command line, if possible.
Any assistance is greatly appreciated.
Is that what you were looking for? If you don’t want to have to cd to c:\ on a separate line then change it thusly:
There you go. One-liner. 🙂