Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
Thanks. That solved the issue. –  Zach L Nov 7 '13 at 6:41

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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