[powershell] ScheduledScripts - cron folders for Windows!

Discussion in 'Scripting' started by cx, Mar 6, 2018.

  1. cx

    cx MDL Novice

    Mar 22, 2015
    12
    16
    0
    Cron styled scripting for Windows!

    https://github.com/buildcenter/ScheduledScripts

    TL;DR
    1. Write your PowerShell script
    2. Drop it in C:\ProgramData\Scheduled Scripts\Tasks\Daily
    3. Watch mom, it runs every day!
    Awesome!
    • MountVHD: auto mount you vhd on computer start
    • GetBingWallpaper: download Bing wallpaper to %public%/Pictures/Slideshow, everyday. Set your wallpaper and lock screen to slideshow, add your slideshow folder to its search path, and voila! Great pictures without Windows spotlight advertising!
    • More to come!
    This is a simple cron system that executes scripts using Task Scheduler. You don't need to install any exe, or run any additional background process you don't have now.

    Scripts are protected using NTFS acl. You need admin rights to modify/add/remove scheduled scripts.
     
  2. cx

    cx MDL Novice

    Mar 22, 2015
    12
    16
    0
    Reserved space.
     
  3. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,396
    1,322
    120
    Just few days ago thought about something similar, but I need it for using to run cron-jobs in such a servers, where cron-jobs are not allowed (for example in some free servers). Then may run them from local computer or in some other server.
    So, thanks, idea isn't just new, but it may be useful for some.
    Maybe You want to establish something like I said - to run cron-jobs in servers if by default it isn't allowed there.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. netlords

    netlords MDL Novice

    Jun 20, 2012
    35
    6
    0
    Hi

    first of all - thank your for your work!

    Will this also work under windowsPE - I´m looking for an solution for this unusual os..
     
  5. cx

    cx MDL Novice

    Mar 22, 2015
    12
    16
    0
    I don't believe winpe supports scheduled tasks. If you want to run something on system start, use winpeinit.cmd
     
  6. cx

    cx MDL Novice

    Mar 22, 2015
    12
    16
    0
    If your free servers allow powershell remoting, you can run cron scripts off your local machine that `invoke-command` the remote server. I will play around with the idea a bit. Tks for the suggestion!