seadoggie01 Posted July 14, 2023 Posted July 14, 2023 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 functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types
argumentum Posted July 20, 2023 Posted July 20, 2023 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now