Run script after each boot, but after checkin
We have a group of computers that we need to have run a small .BAT file every time they boot up, but after they are connected to wifi and have checked into the KBOX. I seem to be hitting a wall. If I set it to "run at user login," it will run the file before the computer is actually connected to the network. What would be best is a way to run the script at first checkin after each boot. Is this even possible?
1 Comment
[ + ] Show comment
Answers (3)
Please log in to answer
Posted by:
chucksteel
8 years ago
The best approach might be to have the script check if there is an active connection and then check the date on c:\ProgramData\Dell\KACE\inventory.xml. That file is generated when the computer runs an inventory. If the conditions aren't met then the script would sleep and then try again. It would take some coding skill and would probably be easier in PowerShell.
Another option is to use a scheduled task on Windows. You can configure a scheduled task to require a specific network connection to be available. You can also have a trigger based on an event in the event log. KACE doesn't add anything to the event log but you could either just wait a specific amount of time and assume the inventory ran. Another interesting option would be to create a custom inventory rule that would run a command like this:
eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO KInventory /D "Running KACE Inventory"
That would create an event in the application log which you can use as a trigger for a scheduled task. I'm not sure if you can limit the scheduled task to only run once after the machine is booted, but you could have your script setup to set a marker file and then have a shutdown task that deletes that marker if it is that important.
Posted by:
SMal.tmcc
8 years ago
Posted by:
JC_Chi
7 years ago
Sorry I wasn't clear about that originally, and I do appreciate the suggestions. - abellante 8 years ago