Many a times we need to automatically execute files based on their extentions. I guess it can be done through AUTOIT. Can someone please direct me on this?
This was helpful in getting the extensions.
$parts = StringSplit($file,"\.",0)
$ext = $parts[$parts[0]]
$filename = $parts[$parts[0] - 1]
Then how do you set up the conditional execution?
Comparing Extensions
Assuming you want to be comparing against a range of extensions, the easiest method is a switch statement:
Letting the shell execute files
What I think you actually want to do is let the computer decide what the best program to execute a file is. This information is stored in the registry along with the extension (in HKEY_CLASSES_ROOT) but you don’t need to know any of that, as a special function called ShellExecute is provided. This uses the extension to run the default handler for the file (with the option of using a given “verb”). e.g: