reg add

G

gs

how would one enter data with quote marks for reg add?


For example if I want the data to be
"somedrivePathSpec\a pgm.exe" %1
I tried
reg add HKCR\test\testapp\shell\open\command" /ve REG_SZ /d
"""somedrivePathSpec\a pgm.exe"" %1"

I also tried using % in front of quote. also tried ^ but none worked
 
G

Guest

not understanding. let's see your example with\".

Thanks

----------------------------------------------------
 
T

Torgeir Bakken \(MVP\)

Hi,

"gs" wanted to add some text to the registry, including a couple of
quote marks ("somedrivePathSpec\a pgm.exe" %1), this because of the
space in the file name/path.


To be able to do that with reg.exe, "gs" needed to change

"""somedrivePathSpec\a pgm.exe"" %1"
to
"\"somedrivePathSpec\a pgm.exe\" %1"

(in this context, \ is a control character that tells reg.exe to
interpret the next character as ordinary text that is part of the value
data to be put in registry)

So this will work:
reg.exe add HKCR\test\testapp\shell\open\command /ve /t REG_SZ /d
"\"somedrivePathSpec\a pgm.exe\" %1"
 
G

Guest

Torgeir,

If I could get your help on this one, I would appreciate it.

I have a line in my [GUIRunOnce] section that doesn't work and it looks like
this:

Command0="cmd /c del "C:\Documents and Settings\All Users\Desktop\MSN
Explorer.lnk""

I know I need quotes around the whole command, but I also need quotes around
the path since it has spaces in it. How do I get this to work with a
directory path that has spaces in it?

If I carry out the command as follows, it works perfectly:

Command1="cmd /c del C:\Docume~1\AllUse~1\Desktop\MSNExp~1.lnk"

Thanks, Rick Blake

-----------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top