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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Speech Marks help !

Status
Not open for further replies.

JKPeus

MIS
May 11, 2005
19
US
I am trying to produce my first VBScript.

I would like to add a reg enty using the wshShell.RegWrite object.
The problem lies in that the value of the reg key i want to add, has a " in it, and this upsets the whole process.
This is the troublesome line: -
wshShell.RegWrite "HKCR\xlr_auto_file\shell\edit\command\", ""C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" /e", "REG_SZ".
Obviously the double speech marks can't be used but i'm not sure what to do.
I have tried using char(34) but not sure on the correct way to do it.

Any help would be greatly appreciated.

JK
 
[tt]>wshShell.RegWrite "HKCR\xlr_auto_file\shell\edit\command\", ""C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" /e", "REG_SZ"

wshShell.RegWrite "HKCR\xlr_auto_file\shell\edit\command\", "[red]""[/red]C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE[red]""[/red] /e", "REG_SZ"
[/tt]
 
I have tried using char(34) but not sure on the correct way to do it
wshShell.RegWrite "HKCR\xlr_auto_file\shell\edit\command\", Chr(34) & "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" & Chr(34) & " /e", "REG_SZ"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for your help.
Went with tsuji's method.

Thanks all.

JK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top