/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


How to delay Task 2 in scripting?

05/26/2015 2560 views
Task 1)

Directory: $(KACE_SYS_DIR)

File: cscript.exe

Parameters: $(KACE_DEPENDENCY_DIR)\yourscript.vbs

I need a delay until this script is completely finished. Wait for completion is not working.

2) Install software after task 1 is finished.



I am trying to run an Office 2010 uninstaller but Office 2013 install runs at the same time.
0 Comments   [ + ] Show comments

Comments


All Answers

0
Can you run it via a batch file? If so, you could have TIMEOUT be the first line of the script and delay for however many seconds you think would cover the necessary time. 
Answered 05/26/2015 by: rockhead44
Red Belt

  • That doesn't work in Kace.
    • Sure it does, when you call a file as in your example, you would call the .bat file.
      • I called the batch file which called cscript for the vbs file and I could not get it to work in Kace. Do you have a specific working example?
      • This content is currently hidden from public view.
        Reason: Removed by member request For more information, visit our FAQ's.
  • When I run a batch file with a timeout or ping command to delay tasks, there is still no delay between the tasks in KACE.
0
Part of the problem is that given your scenario, the K1000 doesn't have any way to know that the .vbs file completed.  It really only knows that the .vbs file was called successfully.

The best way to do it in my opinion would be to modify the .vbs that uninstalls 2010 to call the 2013 install when it's complete.

The .bat idea would be one way to delay the task.  Put in a timeout, then call the Office 2013 install.

If you use the .bat, I'd suggest having the second task verify that Office 2010 is uninstalled before it runs the 2013 task.
Answered 05/26/2015 by: jknox
Red Belt

  • Do you have an idea of something that Kace does know completes successfully? If so I can just run whatever that thing is to stall for time.
    • it knows this over return codes, so drop a return code at the end of the .vbs
      • I tried adding this return code at the end of the vbs and it did not work:

        DIM returnValue
        returnValue = 99
        WScript.Quit(returnValue)

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