2

I was attempting to issue the following FORFILES command, and I recieved an error that distressed me (listed after the command).


C:\Windows\system32>FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*9.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /norestart"

ERROR: Invalid syntax. '/c' option is not allowed more than '1' time(s). Type "FORFILES /?" for usage.


I've gone over the command a few times, and it seems to be correct, but clearly isn't. I've verified the paths and arguments. I'm running the command-line as administrator on Windows 7 32-bit SP1. Any insight would be much appreciated.

| |
3

I'm thinking you copy and pasted the syntax into cmd. You are probably facing the smart quote issue. Retype the script yourself instead of copy and pasting. Or copy to notepad, erase the quotes and then put the quotes back. then copy that and paste to cmd. Sounds silly but it is a known issue.

| |
1

You've to use the Escape-Sign ^ for some other signs like this:

FORFILES /P "%WINDIR%\servicing\Packages" /M "Microsoft-Windows-InternetExplorer-*9.*.mum" /c "cmd ^/c echo ^"Uninstalling package @fname^" ^&^& start ^/w pkgmgr ^/up:@fname ^/norestart"

Than it should work. I don't try it with your line, but got the same error sometimes.

| |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.