MyWebServer
Home Free Downloads Docs FAQ's The Collective Community Tools Help About MyWebServer

MyWebServer |   Technical Info
 
  Startup And Shutdown Scripts

Warning : This feature is completely untested and may not work at all or completely.

My Web Server looks for User Startup .bat and User Shut Down .bat files in the same directory which MyWebServer is located. If these files are present they will be executed each time MyWebServer is started or stopped. These scripts can be used to launch programs or run other scripts ect each time your web server starts and stops. This might be usefull as a way to register yourself with your dynamic dns server or any other web resource each time you start or stop your web server. These .bat scripts receive important data arguments from MyWebServer that can be used in the scripts like your IP Address, Port Number and Host Name as well as the MyWebServer Virtual DNS redirector data listed in your ServerProperties Page.

UserStartup1.bat        Runs each time Server 1 is started.
UserStartup2.bat        Runs each time Server 2 is started.
UserShutdown1.bat       Runs each time Server 1 is stopped.
UserShutdown2.bat       Runs each time Server 2 is stopped.
Each script receives the following command line arguments when it is called. 

 

The arguments are accessible DOS bat files by their position on the command line. 

Argument Number Identifier Description of Argument
1 %1 FTP Site name to connect to
2 %2 FTP User ID
3 %3 FTP Password
4 %4 FTP Path to upload the redirector file to
5 %5 FTP Name of file to upload
6 %6 The name and version of MyWebServer
7 %7 Your computers IP address
8 %8 The port number for this server

The following example UserStartup.bat file runs an imaginary DNS Registry Program called RegisterMyDynamicIPAddress.exe and it passes it just three command line arguments. The first command line argument that is required is the user name of the person who wants to register their IP address (identified by %2). The second argument is the password of the person who wants to register their dynamic IP address (identified by %2). The third argument is the IP address that is to be registered (identified by %7). The %2 and %3 arguments get their data from the 'FTP User ID:' and 'FTP Password:' fields of the MyWebServer Server Properties Page respectively.

 Example UserStartup.bat 
RegisterMyDynamicIPAddress %2 %3 %7

 

 
 

[ Home ] [ Downloads ] [ Docs ] [ FAQs ] [ The Collective ] [ Community ] [ Tools ] [ Help ] [ About ]