Wednesday, December 9, 2009

Create shortcut for restarting ColdFusion 8 server

     While developing applications in ColdFusion we may have to restart the CF server occasionally. We have to go to "Windows Services" and then restart the server. This can easily be achieved by creating a shortcut for the restarting process so that you can just click and restart the CF application server without going to the windows services window.

     For this, you have to first find out the location of jrunsvc.exe. You can find this by going to Services window (by running services.msc) and open the ColdFusion 8 Application Server. Take the whole path from "Path to executable" along with quotes. Also take the "Service name" (this should be "ColdFusion 8 Application Server").

Now, open a notepad and enter two lines as below.

<"Path to executable"> -stop <"Service name">
<"Path to executable"> -start <"Service name">

and save the file as a batch file with a name of your choice (I prefer restartCF.bat).

So, the content of the batch file as per the example will be :

"C:\ColdFusion8\runtime\bin\jrunsvc.exe" -stop "ColdFusion 8 Application Server"
"C:\ColdFusion8\runtime\bin\jrunsvc.exe" -start "ColdFusion 8 Application Server"

Just double click this file and your CF Application server will be restarted.