Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How to add a string value in registry that has double quotes " "

$
0
0

Hi folks. I've been able to successfully add reg string values by using the get-item -path and new-itemproperty commands in powershell for windows 2012 but am having difficulty adding a value for a reg string that has double quotes in it. the command i'm using is as follows, since i found out via google searches that double quotes need a back slash (\) before the double quotes. Not having much luck. Can someone advise what i'm doing wrong please? Thank you

So to clarify, the string name will be "cmdline", the Type will be "REG_SZ" and lastly the data value should be -ap "awesomeapp"

Yes that has to be a hyphen right before the letters ap, followed by a space, and two "" around awesomeapp

get-item -path HKLM:\Software\Wow6432Node\randomapp\whitelist\3 | new-Itemproperty -name cmdline -value -ap "\"awesomeapp\""

 

Get an error saying "the input object cannot be bound to any parameters for the command..."


Viewing all articles
Browse latest Browse all 6937

Trending Articles