/ Published in: TCL
Expand |
Embed | Plain Text
proc _defaultApp {extension} { # Find the name of the default application for a given file extension. # This procedure searches the "HKEY_CLASSES_ROOT" key in the Windows registry. package require registry if {[catch {set fileType [registry get "HKEY_CLASSES_ROOT\\$extension" ""]} ]} { puts "There is no default application assigned to '${extension}' files." return 0 } else { if {[catch {set defaultExe [registry get "HKEY_CLASSES_ROOT\\${fileType}\\shell\\open\\command" ""]} ]} { puts "The default executable name for '${extension}' is not defined in the registry." return 0 } else { return $defaultExe } } }
You need to login to post a comment.
