PDA

View Full Version : File association problem



augustwind
02-24-2007, 11:49 PM
I'm trying something -
if chktxt then
Registry.SetValue(HKEY_CLASSES_ROOT, ".txt", "", "MyApp", REG_SZ);
Registry.SetValue(HKEY_CLASSES_ROOT, "MyApp\\\\shell\\\\open\\\\command", "", SessionVar.Expand("%AppFolder%\\\\MyApp.exe\\"%1\\""), REG_SZ);
(<-- error on above line)
end

but I get an error:
')' expected near '%'

I was not sure about the 'MyApp' part though, so I assumed it might be a mistake - (since it mentions 'KQXEditor' as the application)

I copied it directly from the knowledgebase article here (changing only the MyApp part):
http://support.indigorose.com/v3/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=357&nav=0,8

any ideas on how to resolve this?

Lorne
02-26-2007, 10:49 AM
I'm trying something -
if chktxt then
Registry.SetValue(HKEY_CLASSES_ROOT, ".txt", "", "MyApp", REG_SZ);
Registry.SetValue(HKEY_CLASSES_ROOT, "MyApp\\\\shell\\\\open\\\\command", "", SessionVar.Expand("%AppFolder%\\\\MyApp.exe\\"%1\\""), REG_SZ);
(<-- error on above line)
end

but I get an error:
')' expected near '%'

I was not sure about the 'MyApp' part though, so I assumed it might be a mistake - (since it mentions 'KQXEditor' as the application)

I copied it directly from the knowledgebase article here (changing only the MyApp part):
http://support.indigorose.com/v3/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=357&nav=0,8

any ideas on how to resolve this?
You have two quotes in the middle of your path that aren't escaped properly.

If you want to include a quote in a string, you need to escape it using \" so that line should be like this:


SessionVar.Expand("%AppFolder%\\\\MyApp.exe\\\"%1\""), REG_SZ);

I've color-coded the two escape sequences you need so they're easier to see. :)

augustwind
02-26-2007, 11:02 AM
[QUOTE=augustwind;96632]
I copied it directly from the knowledgebase article here (changing only the MyApp part):
http://support.indigorose.com/v3/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=357&nav=0,8
QUOTE]


Thanks - since that's what you pointed out, I'm assuming the other stuff looks all right - -
However, since I copied it directly from that KB article - you might want to update it to reflect this...
I'll give it a shot this evening