Online Chat
 Call Us: 
Browse Submit a Ticket
Advanced Search
Rss Categories

Setup Cron job on Windows XP/2003

Author: Edward Hardin Reference Number: AA-00485 Views: 23440 Last Updated: 11/29/2011 02:56 PM 56 Rating/ 4 Voters

  1. Create a new text file somewhere, for example in the root of disk C. Name it "cron.vbs".
  2. Put these lines into the file with the replacements specified below:

    Set WinScriptHost = CreateObject("WScript.Shell")

    WinScriptHost.Run "%PATH-TO-PHP%\php.exe %PATH-TO-KMP%\admin\CRON\cron.php %URL-TO-KMP%/", 0

    Set WinScriptHost = Nothing

    Replace %PATH-TO-PHP% with path to php executable file (php.exe). Be sure to use "php.exe", not the "php-cgi.exe"!

    Replace %PATH-TO-KMP% with physical path (not URL) where you have installed KnowledgeBase Manager Pro.

    Replace %URL-TO-KMP% with URL to location where you have installed KnowledgeBase Manager Pro (if open this URL in your browser, you'll see the front-end part of your knowledge base). Please note that website name should not be "localhost", otherwise you would get incorrect URLs in emails that KMP sends - users won't be able to open articles they are subscribed to, reset password, etc.


    Set WinScriptHost = CreateObject("WScript.Shell")

    WinScriptHost.Run "C:\PHP\php.exe c:\inetpub\wwwroot\kmp\admin\CRON\cron.php", 0

    Set WinScriptHost = Nothing

    Example #2 (if PHP and/or KMP path contains whitespaces - in this case, you need to take path to double quotes):
    Set WinScriptHost = CreateObject("WScript.Shell")
    WinScriptHost.Run """C:\Program Files\PHP\php.exe"" ""C:\Inetpub\Some Folder\kmp\admin\CRON\cron.php""", 0
    Set WinScriptHost = Nothing


    Please, do not forget the slash at the end of the last parameter for the php.exe.

    This is correct:

    This is incorrect:

  3. Go to the Control Panel > Scheduled Tasks.
  4. Select File > New > Scheduled Task. Give it an appropriate name, for example "KMP Cron Task".
  5. Double-click on the new task. You will see the window with its properties.

  6. Put the path to the cron.vbs file to the "Run:" field, for example:
  7. Specify user under which this task will run in the "Run as" field.
  8. Click "Set password" and specify password for that user.
  9. Click on the "Schedule" tab.

  10. Click on the "Advanced" button.
  11. Set the "Repeat Task" checkbox and set task to run every minute with duration "24 hours".

  12. Click OK on both windows to save changes. It may ask you for a password for the user under which this task will run. Enter it and click OK.
  13. Open the KMP control panel and go to Administration > General Settings > Auto Related Articles. You may see the following message there previously: "You have to setup cron script in order to use this functionality."

  14. This message will disappear after the first run of the Cron script. Click "Recheck"  in about a minute to see that Cron job has been successfully installed.