Set file associations from a batch file???

July 4, 2009 at 11:47:09
Specs: Windows
Hi, I'm trying to associate a type of file to an app from a batch file using reg add command:
reg add hklm\software\xxx /ve /t reg_sz /d ""%cd%\prog.exe" "%1""
but it doesn't write in the registry exactly what I want.I think something is wrong in the /d switch! can you
help?

PS:I want something like this to be written in the registry but only using the reg add command:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\xxx.Document\shell\open\command]
""="\"C:\\Program Files\\app.exe\" \"%1\""
and
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\xxx.Document\shell\open\ddeexec]
""="[open(\"%1\")]"

I wrote a script that creates a reg file on-the-fly, and it works,but I need to do the same only using the reg
add command...help me please!


See More: Set file associations from a batch file???

Report •


#1
July 4, 2009 at 17:53:44
I assume yo using xp or higher by the reg.exe syntax.

Xp has built in tools for file association:

Assoc
ftype



Report •

#2
July 5, 2009 at 01:46:37
it works, thank you!

Report •

Related Solutions


Ask Question