Hi I am creating a housekeeping script for Windows Drives.
I have seen in the past that using rm -rf command via nsh on a windows target appears to be slower that the windows native forfiles command.
I have my command working natively via command prompt:
forfiles /p "C:\Windows\Temp" /s /c "cmd /c Echo Deleting @file"
This returns of all files and directories preceeded by Deleting.
I have added this to an an nsh type 1 script and making use of Nexec as follows:
nexec -e cmd /c "forfiles /p "C:\Windows\Temp" /s /c "cmd /c Echo Deleting @file""
Which returns the following error:
Error: Invalid syntax. '/c' option is not allowed more than '1' time(s).
Type "FORFILES /?" for usage
I therefore tried the following approach on the native windows command prompt:
cmd /c "forfiles /p "C:\Windows\Temp" /s /c "cmd /c Echo Deleting @file""
Which also executed successfully with a list of file names.
There only appears to be an issue when i nexec - e it?
nexec -ncq -e cmd /c "forfiles /p \"C:\temp\" /s /c \"cmd /c echo Deleting @file\""