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

Comments

  • I appreciate the suggestions, so far. Unfortunately, the fix I need requires that no information can change on the clients, as they will lose those changes on next reboot. So copying a file, changing registry keys, etc. just won't be a viable solution.

    Sorry I wasn't clear about that originally, and I do appreciate the suggestions.
Please log in to comment

Answers

0
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.

Answered 04/29/2016 by: chucksteel
Red Belt

Please log in to comment
0
create a script that places the command you want to run under the HKCU\software\....\run key.  Then that will run every time after the user logs in by calling that run command key.
Answered 05/02/2016 by: SMal.tmcc
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity