Script not running at check-in
I have a batch file that basically renames a file - nothing complex. If I do a RUN NOW, it works. However, I have it set for offline mode, and I want it basically to run on a label of machines the next time they check in. I've tried "no schedule" with "allow once at next checkin" as well as trying " machine boot up" and "machine check in". I've forced an update. Doesn't work.
Again, it works if I do a run now, but I don't want that. We basically have a file on the machines causing a memory leak, and we just want to rename it for now rather than remove it from the machine. I still can't figure out how to get this to run properly upon next check-in or comuter startup.
Any help is appreciated
Answers (4)
Change it to an "online script" and set the schedule to run the same amount of hours your agent check in time is
Change it to an "online script" and set the schedule to run the same amount of hours your agent check in time is. See if that works.
Comments:
-
Wouldn't this make it run every 2 hours in my case? I only want it ran once. - sfigg 12 years ago
-
Take a look at my answer here http://www.itninja.com/question/how-to-replace-a-file-with-scripting-on-k1000 You can modify it for what you need.
In your existing batch file add something that Kace can see. That way on the "verify" step it will see that it has already been ran, and will not run again. - dugullett 12 years ago
-
Thank you - this works well! - sfigg 12 years ago
Have you tried VBScript for this.
Use objFSO.MoveFile command to replace the file.
I have written a script for find and replace in VBSCript which has a small function of renaming file.
You can have a look here.
http://msiworld.blogspot.com.au/2012/07/vbscript-to-find-and-replace.html
create a push with condition if file exists
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v renamefile /d "rename c:\windows\badfile.exe badfile.exeold"
on the kace1000 go the scripts tab, create an online script, tell it the machines you want and create this task