Can I nest a command string within another command string?
Posted
by
Zach L
on Super User
See other posts from Super User
or by Zach L
Published on 2013-11-07T20:31:56Z
Indexed on
2013/11/07
22:01 UTC
Read the original article
Hit count: 220
Whenever I run the following command in an elevated command prompt, I get the 0x80070005 Access Denied error code. I'm assuming it's a permissions error for the child shell. I'm running the command in an elevated prompt on Winddows 7 Pro SP1.
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-* 9.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /norestart"
Can place the "Runas" command within the already nested command in order to run the child shell as an admin? I don't think I can because of conflicts with quotation mark locations. If there's another way to do this, such as via a batch file, I'm open to alternative methods, although I do prefer running it as a single string.
Sidenote1: Ignore the space after the first asterisk in the command string. It was added one for aesthetics & accuracy.
Sub-question: Could I use this "fix" to circumnavigate the problem entirely? Prompt as Administrator?
© Super User or respective owner