hello I write this little interpreter that reads a script and executes it, right now you would do something like ,
linux
./myProg filePath
windows
myProg.exe filePath
and it would read the file in an execute it, but I would like to be able to just click on the file on the desktop (in both windows and linux) and have the program run, (like how python works) , i'm pretty sure in windows I would need to play around with the registry , but i'm not sure how to do it in linux .
people suggested to use #! , but I would really like to avoid that , I want it to just look at the extension and execute accordingly, any suggestions?
as for windows, I am also not very confident with the registry, are there any tools that could just make it easier? or any tutorials I can read ? thank you very much
how do you associate files
- Azgur
- Goblin
- Posts: 264
- Joined: Thu Aug 21, 2008 4:48 pm
In windows it's pretty easy if you use a file extension that hasn't been registered yet.
Just try to open the file by double clicking it, windows will complain a bit about unknown extension etc, tell it you will select the application from a list, hit browse, navigate to your exe, hit ok a few times and you're done.
Just try to open the file by double clicking it, windows will complain a bit about unknown extension etc, tell it you will select the application from a list, hit browse, navigate to your exe, hit ok a few times and you're done.
- syedhs
- Silver Sponsor

- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
To change for already registered extensions, simply hold down Shift key while right clicking on the file. You will find 'Open With' in the menu which sometimes appear or doesn't without holding the Shift key.Azgur wrote:In windows it's pretty easy if you use a file extension that hasn't been registered yet.
To the original question, maybe you can simply use 'shell'? Or in windows, use ShellExecute on the file will always launch the associated application.
Actually I am not very clear about your question because your original and subsequent questions are quite contradicting.
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me