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".
ASKER CERTIFIED SOLUTION
Qlemo
"Batchelor", Developer and EE Topic Advisor

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2015

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
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