Restoring a Registry Setting thru VBS

Reply

Join Date: Mar 2004
Posts: 54
Reputation: Khiladi420 is an unknown quantity at this point 
Solved Threads: 0
Khiladi420 Khiladi420 is offline Offline
Junior Poster in Training

Restoring a Registry Setting thru VBS

 
0
  #1
Dec 19th, 2004
anyone know how to get around this:

WshShell.RegWrite "HKEY_CLASSES_ROOT\exefile\shell\open\command\", ""%1"%
*"

I cant seem to include more than 2 " at the end there if i just do "%1 %
*" then it will succesfully write to the registry but it needs the extra 2 " in there & i dont know how to get around that, anyone know???
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Restoring a Registry Setting thru VBS

 
0
  #2
Dec 28th, 2004
Originally Posted by Khiladi420
anyone know how to get around this:

WshShell.RegWrite "HKEY_CLASSES_ROOT\exefile\shell\open\command\", ""%1"%
*"

I cant seem to include more than 2 " at the end there if i just do "%1 %
*" then it will succesfully write to the registry but it needs the extra 2 " in there & i dont know how to get around that, anyone know???


WshShell.RegWrite "HKEY_CLASSES_ROOT\exefile\shell\open\command\", chr(34) & "%1" & chr(34) & "%*"

the chr(asc) function returns the character represented by the ascii code passed to it. 34 happens to be the ascii double quote character. So, You terminate your string, use concantenation ( the & ) to append the character code 34 (double quotes) to your string.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Windows NT / 2000 / XP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC