DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Windows NT / 2000 / XP (http://www.daniweb.com/forums/forum10.html)
-   -   Restoring a Registry Setting thru VBS (http://www.daniweb.com/forums/thread15814.html)

Khiladi420 Dec 19th, 2004 1:20 pm
Restoring a Registry Setting thru VBS
 
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???

Comatose Dec 28th, 2004 10:25 pm
Re: Restoring a Registry Setting thru VBS
 
Quote:

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.


All times are GMT -4. The time now is 6:14 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC