Jump to content

Recommended Posts

Posted

This is a pretty basic script that I use to to start scripts and other programs, since my job involves a lot of small tasks that I've worked to automate. I could create shortcuts to all the scripts and put them somewhere, like a folder on the start menu, but that's not as much fun when I can write a script to store them for me. Adding them to a TrayIcon helps keep find them and keep them organized a bit better. Also, I have some tasks that I would normally add to the startup tasks, but it's work, so I need to clock in before I start, so this helps delay those scripts. The basic idea was that when I start the script, it will run a couple of scripts, open a webpage, and start a couple of programs. Later in the day, I get an email with a request and use one of the tasks to handle it.

Startup tasks will only start if they are not already running. Manually clicking the startup tasks will always run the task. Currently running scripts are checked using a modified version of @Exit's code:

I modified the script to allow for checking other scripts instead of the current one. (Please feel free to steal the code back or implement my idea better!) I'm linking that because I've redistributed it, but slightly modified. Check out Exit's original script, it's super handy! :)

You can find the script on GitHub along with an example and description of the config file: https://github.com/seadoggie01/Startup

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Posted

so there is 

$oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
        If @error Then
            RunWait(@ComSpec & ' /c net start winmgmt  ', '', @SW_HIDE)
            RunWait(@ComSpec & ' /c net continue winmgmt  ', '', @SW_HIDE)
            $oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
            If @error Then Return SetError(1999, 1, "oops ?") ; <-- what if that fails too ?
        EndIf

maybe I overengineer stuff but, what if(s). Anyway, just reading the code. Thanks for sharing :)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...