Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing Encrypted Value to Registry failing help!

Status
Not open for further replies.

kajaeger

Programmer
Oct 5, 2001
17
US
I need to write an encrypted value to the registry it looks like a square in the first position + "mra".. vbscript thinks its a "return" and gives me an "Unterminated string constant" message with a "Code :800A0409" when I try to write the string.

Ideas? Even when I cut and paste my code below it makes a return instead of a little box...it looks fine on my screen withing VBS:

Set objShell = WScript.CreateObject("WScript.Shell")objShell.regWrite "HKLM\SOFTWARE\USPS\SAMS\Data Access\MAEPassword", "
mra", "REG_SZ"
 
Hello, kajaeger.

If it is an encyrpted entry with a square, then it is not "REG_SZ", is it?

regards - tsuji
 
Honestly, I am clueless here. I cannot even define the string with a square in it without getting an error on the variable declaration line of the vbs code. My WISE installation isn't accepting the string either. I cannot even pull the encypted value into a reg file and execute reg file and get it to work. Basically my client wants to give me the encrypted format of the passwords and have my installation write them to the registry. They feel this will eliminate user error for installing these settings on over 100 servers. Plus, it is against the rules they have to have a plain-text password visible in the install scripts.
 
You have to know the binary value byte by byte. "mac", you know. What is "square"?

- tsuji
 
I had a similar problem using entering registry entries with VB script. I had to find the ascii value of the data and use that instead of the literal data. I would first find the asci value of MRA and then put that value in the script instead of mra. I had a long 25 digit code that took a while to tweak but iti did work great.
 
Same as davmar92,

I wrote a script to get header information out of our own home made software distribution system packages, but I kept getting strange results and the odd error. What I finally did was open one of the smaller packages in UltraEdit, located the non alpha-numeric characters and changed the view it in Hex format. Once I had the hex value I assigned a variable say KillerChar = Chr(00) to get the script to stop once it reached one of these characters as they were used as terminators within the package.

Clint
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top