CGIRemote

©2002 by Moisés Cambra
A freeware PC Remote Control tool. Version 1.0

What is CGIRemote?

It's a small CGI (Common Gateway Interface) server-side application for Windows that allows sending commands to PC Remote Control (PCRC) from any Web browser.

How to set it up

You need a Web server to run it, for example: Microsoft IIS (included in Windows 2000), Apache, TinyWEB, etc. The only requirement for the server is to accept the execution of CGI applications.
  • Once your server is up and running, find the cgi-bin directory or create a new one with permissions of execution enabled and copy there the executable cgiremote.exe.
  • Launch PCRC and create a few commands if the list is empty.
  • Open a Web browser and make it point to the URL address http://localhost/cgi-bin/cgiremote.exe or similar if you used a different directory.
  • If CGIRemote can connect with PCRC, it will show a selection box filled with the commands available on PCRC. If for some reason, PCRC is not running or there is any communication problem, CGIRemote will return the message CGIRemote: Unable to connect to PC Remote Control.

    How to use it

    When executed without parameters, CGIRemote returns the list of commands in a bare html selection box, ready to be inserted inside a customized webform. A proper way to do it is by using Server Side Includes (SSI):
  • Create a simple web page with the appropiate extension (typically .shtml) so that the web server will take into account the SSI parts you write.
  • Insert a web form with the following text:
    <form action="/cgi-bin/cgiremote.exe" method="post">
    <!--#exec cgi="/cgi-bin/cgiremote.exe"-->
    <input type="submit" value="Execute command">
    </form>
  • The form above should show the selection box and to its right a button with the text Execute command. If there is not selection box, perhaps there is a problem with the SSI. Try putting the .shtml file in the same directory where CGIRemote is.
  • If your set of commands doesn't change frequently, or there is no way to make SSI working, you could also write one by one the commands inside the form above, like this:
    <form action="/cgi-bin/cgiremote.exe" method="post">
    <SELECT name=cmd>
    <OPTION selected>First command</OPTION>
    <OPTION>Second command</OPTION>
    <OPTION>Third command</OPTION>
    </SELECT>
    <input type="submit" value="Execute command">
    </form>
    The above form should look similar to this:
    CGIRemote also allows the introduction of parameters in the URL string. You can directly type the commands on the location bar of the web browser, or create a set of links on a web page without relying on web forms. For example, the URL http://localhost/cgi-bin/cgiremote.exe?cmd=First command would be equivalent to clicking the submit button on any of the forms above. Alternatively, a link to that same command in a web page would be like this: <a href="/cgi-bin/cgiremote.exe?cmd=First command">Link to First command</a>

    Reference list

    Request/Query Parameter Function
    <none> <none> Returns html code that shows a selection box filled with the commands of PCRC.
    Example: http://localhost/cgi-bin/cgiremote.exe
    cmd <command> Tells PCRC to execute the command sent as parameter.
    Example: http://localhost/cgi-bin/cgiremote.exe?cmd=Play song
    get form Returns a complete web form with a selection box filled with the commands of PCRC.
    Example: http://localhost/cgi-bin/cgiremote.exe?get=form
    list Returns a simple text list of the commands of PCRC.
    Example: http://localhost/cgi-bin/cgiremote.exe?get=list