Navigate
Sponsors
|
SSI Exec CommandIntroductionThe exec command simply executes a program, script or a shell command on the server. It takes two formats "Exec CMD" which is used to run a command and "Exec CGI" which can be used to execute a script. Exec CommandsThis executes the Unix date command. <!--#exec cmd="/usr/bin/date" --> This executes a CGI script called logger.pl <!--#exec cgi="/logger.pl" --> There are many uses for this command, one example i use is for my stats package: <!--#exec cgi="/user-stats/stats.pl" --> Other examples include: <!--#exec CMD="cmd.exe /C iisreset /stop" --> <!--#exec CMD="cmd.exe /C net start cisvc" --> IISRESET Utility & SwitchesThe iisreset.exe can be used to manage web services running on a server IF you have relevant permissions. The syntax is iisreset [computer_name] /switch [ /switch...]. The switch values can include:
NET STOP & NET START CommandsThe net.exe can be used to manage services running on a server either locally or from another machine, IF you have permissions. The syntax is net [start | stop] service_name. It's not recommended for services such as FTP or WWW but can be used for example to start or stop the Microsoft Indexing Service: <!--#exec CMD="cmd.exe /C net start cisvc" --> <!--#exec CMD="cmd.exe /C net stop cisvc" --> NOTE 1:: These Commands we used here with the SSI Exec directive are commonly used with Asp so some may not work correctly with SSI. NOTE 2:: For these to work the page must have anonymous access removed and must have Administrative privileges on the target server. NOTE 3:: Don't play with these unless you know what you are doing!! |
||||||||||||||||||||