Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Location
    Canterbury, Kent
    Posts
    270

    Exclamation PowerShell Script to Update MPC Databases - Run on W1ndows Task Scheduler

    Here are the PowerShell scripts for updating the databases...

    Make-MpcOrbDatabase.ps1:

    Code:
    Push-Location 'C:\Program Files (x86)\Common Files\ASCOM\MPCORB'
    Invoke-WebRequest -Uri https://minorplanetcenter.net/iau/MPCORB/MPCORB.DAT -OutFile MPCORB.DAT
    C:\Windows\SysWOW64\cmd.exe /C CScript MakeDB.wsf
    Pop-Location
    ...and Make-MpcCometDatabase.ps1...

    Code:
    Push-Location 'C:\Program Files (x86)\Common Files\ASCOM\MPCCOMET'
    Invoke-WebRequest -Uri https://www.minorplanetcenter.net/iau/Ephemerides/Comets/Soft00Cmt.txt -OutFile CometEls.txt
    C:\Windows\SysWOW64\cmd.exe /C CScript MakeCometDB.wsf
    Pop-Location
    ...and they have to be scheduled in Windows Task Scheduler like this... The text in the "arguments" field is the path to the powershell script, like this:

    Code:
    -file C:\Users\Tim\OneDrive\PoshScripts\Make-MpcOrbDatabase.ps1
    ScheduleMPC.png

    I schedule them to run every 2 days on alternating days, about mid-morning.

    Tim Long
    Managing Director
    Timtek Systems Limited

  2. #2
    Join Date
    Oct 2005
    Location
    Canterbury, Kent
    Posts
    270

    Default

    Here's a zip file containing the two scripts, plus tasks exported from my task scheduler. I'm not sure how well these will import on a different system, and you'll certainly need to check the settings, but they are just XML files so at the very least you'll be able to open them in an editor and see what settings I've used.
    Attached Files Attached Files

    Tim Long
    Managing Director
    Timtek Systems Limited

  3. #3
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,938

    Default

    Thank you Tim!!
    -- Bob

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto-update MPCORB and MPCComet databases
    By Dick Berg in forum Add-Ons, Enhancements, and Helper Components
    Replies: 3
    Last Post: Feb 4, 2019, 17:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •