There is an executable file (called FILE lets say) on my Windows machine which I want to protect from unauthorized access. To achieve this, I know there're different ways but for this particular case I'd like to write a scrip/code so that when the user tries to execute FILE, a PHP webpage opens up and prompts the user for username/pass. The entered combination would then be compared to the entries in a Postgre database, running on a separate machine.
Now, I assume I could maybe write a simple batch file so that the PHP page would open up upon execution of FILE. However, the problem is that I don't know how to make it such that the user will not be allowed to access FILE unless the correct username/pass combination is entered. Frankly I'm not even sure if I can write the mentioned batch file (don't know how to tell the system to open up a webpage through a batch file).
Any help would be appreciated.
P.S> Another way would be to write a C/C++/JScript to do the above, but I don't know how to do that! The thing that mostly keeps me from even trying it would be the fact that I don't have a clue how to 1) implement the window that asks for user/pass, and 2) how to make the program communicate with the Postgre database. So I think the PHP webpage sol'n would be easier to implement.