Can anyone help me with identifying how to get speech marks into the
registry without giving me an error.

I have the following i would like to place in the registry.

"cmd.exe /c MD "%1\NewFolder""

The problem is that by putting the original " " marks at the beginning
and the end of the code seems to limit putting "%1\NewFolder" around
this parameter, which is important in this instance.

The error message states its an: Unterminated string constant Code:
800A0409.

Any help would be most welcome.


TIA


jp

Re: registry and speach marks ie: "...." by jp

jp
Fri Jan 28 05:29:40 CST 2005

Might be helpful if i gave the code that goes with this question.


sProcessLabel = "Tweak: Create New Folder Context Menu."
sRegValue = "HKCR\Folder\shell\NewFolderCommand\Command\"
sDataValue = "cmd.exe /c MD "%1\NewFolder""
sRegType = "REG_SZ"

' Check whether the registry values exist.
' If registry values match then no action else write new values to
registry
If (KeyExists(sRegValue) = True) Then
' Write to audit file
objLogFile.WriteLine vbTab & vbTab &
L_ParameterExists_ErrorMessage & " [" & sRegValue & "]"
sLogFile.WriteLine vbTab & vbTab &
L_ParameterExists_ErrorMessage & " [" & sRegValue & "]"
ClearRegVals
Else
' if the value didn't meet the criteria, script continues here
' Write to audit file
objLogFile.WriteLine vbTab & vbTab & sProcessLabel & " [" &
sRegValue & "]"
sLogFile.WriteLine vbTab & vbTab & sProcessLabel & " [" &
sRegValue & "]"
' Install process
WshShell.RegWrite sRegValue, sDataValue, sRegType
ClearRegVals
End If


jp

On Fri, 28 Jan 2005 11:35:54 +0100, jp <paulm@kcbbs.gen.nz> wrote:

>Can anyone help me with identifying how to get speech marks into the
>registry without giving me an error.
>
>I have the following i would like to place in the registry.
>
>"cmd.exe /c MD "%1\NewFolder""
>
>The problem is that by putting the original " " marks at the beginning
>and the end of the code seems to limit putting "%1\NewFolder" around
>this parameter, which is important in this instance.
>
>The error message states its an: Unterminated string constant Code:
>800A0409.
>
>Any help would be most welcome.
>
>
>TIA
>
>
>jp


Re: registry and speach marks ie: "...." by Torgeir

Torgeir
Fri Jan 28 05:29:10 CST 2005

jp wrote:

> Can anyone help me with identifying how to get speech marks into the
> registry without giving me an error.
>
> I have the following i would like to place in the registry.
>
> "cmd.exe /c MD "%1\NewFolder""
>
> The problem is that by putting the original " " marks at the beginning
> and the end of the code seems to limit putting "%1\NewFolder" around
> this parameter, which is important in this instance.
Hi

Inside a quoted string, use two quotes to get one effective:

'--------------------8<----------------------

sValueData = "cmd.exe /c MD ""%1\NewFolder"""

Set oShell = CreateObject("WScript.Shell")
oShell.RegWrite "HKLM\Software\Test\Test", sValueData, "REG_SZ"
'--------------------8<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: registry and speach marks ie: "...." by jp

jp
Fri Jan 28 05:54:57 CST 2005

Thanks a lot, works like a dream.

jp

On Fri, 28 Jan 2005 12:29:10 +0100, "Torgeir Bakken \(MVP\)"
<Torgeir.Bakken-spam@hydro.com> wrote:

>jp wrote:
>
>> Can anyone help me with identifying how to get speech marks into the
>> registry without giving me an error.
>>
>> I have the following i would like to place in the registry.
>>
>> "cmd.exe /c MD "%1\NewFolder""
>>
>> The problem is that by putting the original " " marks at the beginning
>> and the end of the code seems to limit putting "%1\NewFolder" around
>> this parameter, which is important in this instance.
>Hi
>
>Inside a quoted string, use two quotes to get one effective:
>
>'--------------------8<----------------------
>
>sValueData = "cmd.exe /c MD ""%1\NewFolder"""
>
>Set oShell = CreateObject("WScript.Shell")
>oShell.RegWrite "HKLM\Software\Test\Test", sValueData, "REG_SZ"
>'--------------------8<----------------------