troubleshooting Question

powershell script error modifying registry

Avatar of markc56
markc56Flag for United States of America asked on
ProgrammingScripting LanguagesPowershell
5 Comments1 Solution934 ViewsLast Modified:
I am attempting to push out a registry change via powershell, but I am getting the error:

The string is missing the terminator: ".
  +CategoryInfo      : ParseError: (:) [], ParentContainsErrorRecordException
  +FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

The short line in the .bat file is:

powershell.exe "& Set-ItemProperty HKLM:\SOFTWARE\"abc def"\test\XXX -Name Test -value 50"

I have used this exact line many times to make registry changes and it always works. The only difference is the "white space" between the name ("abc def"). Without the quotation marks ("abc def") it errors out at "def".
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros