Computing.Net > Forums > Programming > Set file associations from a batch file???

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Set file associations from a batch file???

Reply to Message Icon

Name: dyonysos
Date: July 4, 2009 at 11:47:09 Pacific
OS: Windows
Subcategory: Batch
Comment:

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!



Sponsored Link
Ads by Google

Response Number 1
Name: Judago
Date: July 4, 2009 at 17:53:44 Pacific
Reply:

I assume yo using xp or higher by the reg.exe syntax.

Xp has built in tools for file association:

Assoc
ftype



0

Response Number 2
Name: dyonysos
Date: July 5, 2009 at 01:46:37 Pacific
Reply:

it works, thank you!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Set file associations from a batch file???

Open IE from a batch file www.computing.net/answers/programming/open-ie-from-a-batch-file/14896.html

Make an exe with a batch file and.. www.computing.net/answers/programming/make-an-exe-with-a-batch-file-and/17595.html

batch file - reading from a file www.computing.net/answers/programming/batch-file-reading-from-a-file/19110.html