escape parentheses in parameter

by selko at 2013-02-17 22:37:46

Hi,

i am trying to pass the following string to an invoke-command:
" icacls C:\ /grant:r BUILTIN\Users:(OI)(CI)(RX)"

I get this error:
The term ‘OI’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again

How can i escape the parentheses. I tried it with and \<br><br>Thanks</blockquote>by AlexBrassington at 2013-02-18 00:00:17<blockquote>I think that passing the values in using single quotes will tell PowerShell not to modify the string contents.<br><br>The double quotation mark option is generally the same as the single however when a string is in double quotation marks PowerShell will try to process any variables you've got in there.<br><br><code>#Demonstration of single vs. double quotes<br>$var = &quot;Cake&quot;<br><br>#Double quotes will make PowerShell process the contents of the string<br>Write-Host &quot;I love $var&quot;<br><br>#Single quotes will fail to express your love of cake properly<br>Write-Host &#39;I love $var&#39;</code></blockquote>by selko at 2013-02-18 02:41:46<blockquote><code>' C&#58;\ /grant&#58;r BUILTIN\Users&#58;(OI)(CI)(RX)'</code><br><br>it still shows up the same error...</blockquote>by selko at 2013-02-18 03:01:15<blockquote>This works:<br><code>' C&#58;\ /grant&#58;r BUILTIN\Users&#58;(OI)(CI)(RX`)'