in reply to Running a .exe file in perl/cgi in windows 2000 server

It is not a permissions problem. Since IE hangs while trying to access the CGI file, it is clear that the system call to notepad.exe is indeed working. If you check the list of programs running under the 'Processes' tab of the Windows Task Manager while accessing the CGI, I'm confident you will see notepad.exe listed. Since notepad does not exit until the user exits it intentionally, the 'hanging' you are experiencing is notepad waiting for the user to exit notepad.

External programs you execute while within a CGI script are run hidden -- you will not see the graphical interface for the program; in this case, the notepad window. I'm wondering whether you are expecting the notepad window to appear on the server computer that is running the CGI process, or if you're wanting notepad to run on the client's computer.

If you are looking to have the notepad program run on the server side, then the best method I can think of is to have the CGI script add a command to a database to execute (such as 'notepad.exe'), and then write a separate server-type script that will execute these commands outisde the CGI server process. If you're expecting notepad to run on the client's side, you'd have to have the client download the program first.

  • Comment on Re: Running a .exe file in perl/cgi in windows 2000 server

Replies are listed 'Best First'.
Server side
by Anonymous Monk on Dec 08, 2004 at 04:23 UTC
    I wanna firstly thank you for your reply. Actually that .exe file is not notepad.exe . The whole thing belongs to a web-based program that does some kind of online simulation. The program used to be on Apache server and worked fine. Now I am trying to trasfer it on Windows server. But I came across the problem of processing the cgi files in Windows. That exe file is acutally a simulation exe file which reads some data from another txt file and do some calculation and make another output txt file. So the whole thing would be run on the server side, not client side. The user (client) "submit" some data in a html page which will run the cgi file. The cgi file put the submitted data in a txt file, and then calls the exe file and redirect to another html page which would contain the results of simulation. I have problem running that exe file under windows server! if I run the cgi file in the commandline (perl myfile.cgi), everthing works OK and that output is made. However, from IE , it halts in spite of the fact that the related "process" is called( as I checked in the "processor" tab.)
      Hi, I am facing a similar problem, did you find a solution to this? If yes, can you let me know? Thanks a ton. Karan (anand.karan@gmail.com)