/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


How do I add 'if restart/log off:continue script''

11/01/2016 749 views
Hi I am combing two scripts; one that removes local admin from the logged in user, then run ksleep for 10 minutes, then run the script that removes admin from local user. The problem is; if the user restarts at any time during the script, it breaks:

VLcfiQ.jpeg
The idea is to grant admin for around 1.5 hours for short installs and 4 hours for installations of our software using ksleep between the two scripts. But as I mention, if there is a log off/reboot anywhere during the job it fails.

Thanks for any help.
0 Comments   [ + ] Show comments

Comments


All Answers

0
I commented on your other question also.  Create a batch file that runs the remove rights portion and add that as a dependency.  Use Schtasks,exe to make a one time task that runs that batch file at the time you want.  The down side is you will need to modify the line that creates the scheduled task to set the time properly each time you use it.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb736357(v=vs.85).aspx

to point the task to the batch file in the kace directories for the /TR taskrun switch

point at your kscript you made from the script page point to get the id.


then modify that script line that creates the scheduled task to include that id path
/TR C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\416\remove.bat
Answered 11/02/2016 by: SMal.tmcc
Red Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ