Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set program defaults using VBScript

Status
Not open for further replies.

smcc12

Programmer
Jan 8, 2009
17
US
Hello,

I am trying to associate all .ifc file extensions with an executable in my program files. It needs to be done with VBScript, anybody know how?

I've tried doing it manually, then going into the registry and exporting some keys for it but maybe im getting the wrong ones or there's more to it.

Any help appreciated.
 
Solved:

fext = "ifc"
prgid = "IFC File"
des = "IFC File"
extanm = "c:\Program Files\Microsoft Experience Pack for Windows Vista\Ink Flash Cards\InkFlashCards.exe"
Set o = CreateObject("WScript.Shell")
o.regwrite "HKCR\." + fext + "\" , prgid , "REG_SZ"
o.regwrite "HKCR\" + prgid + "\", des , "REG_SZ"
'o.regwrite “HKCR\” + prgid + “\DefaultIcon\”, extico, “REG_SZ”
o.regwrite "HKCR\" + prgid + "\Shell\","Open"
o.regwrite "HKCR\" + prgid + "\Shell\Open\Command\", """" + extanm + """""%1""", "REG_SZ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top