Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

Setup Cron job on Windows 7/Vista/2008

Author: Edward Hardin Reference Number: AA-00487 Views: 39834 Last Updated: 11/29/2011 03:38 PM 0 Rating/ 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, etc.

    Example #1:

    Set WinScriptHost = CreateObject("WScript.Shell")

    WinScriptHost.Run "C:\PHP\php.exe c:\inetpub\wwwroot\kmp\admin\CRON\cron.php http://www.yourwebsite.com/kmp/", 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"" http://www.yourwebsite.com/kmp/", 0
    Set WinScriptHost = Nothing


    Warning

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

    This is correct:

    http://www.yourwebsite.com/kmp/

    This is incorrect:

    http://www.yourwebsite.com/kmp

  3. Go to the Control Panel > Scheduled Tasks.
  4. Open Control Panel and type "Schedule Tasks" into the search field.



  5. You will see the "Schedule Tasks" link. Click on it.
  6. Click the "Create Task" on the right pane.



  7. Give it an appropriate name, e.g. "KMP Cron Task" and set the "Run whether user is logged on or not" radio-button.



     You may want to change user under whom the scheduled task will run.

  8. Go to the "Triggers" tab and click "New...".
  9. Set checkbox on "Repeat task every" and enter "1 minutes" to the next dropdown menu (there is no "1 minutes" item, but you can easily enter it from keyboard).



    Click OK.

  10. Go to the "Actions" tab and click "New...".
  11. Click "Browse..." to select cron.vbs.

  12. Click OK on both windows and you're done with Cron setup.
  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.