I have been working with the K1000 scripting mechanisms as a way of updating Skype the last couple days, and although I have finally figured it out, I am left very confused, and was hoping to straighten out a few things.

My method consists of using wscript with a VBS wrapper that silently launches various batch files. The first thing that happens is a batch is run to stop skype via skype.exe /shutdown. Then I run another batch script to calls a powershell command to uninstall skype. Finally the install skype batch is run, which calls the skype msi silently.

This is what the successful KScript looks like:

My trouble was that it seems that all of those batch scripts end up running at the same time!

My solution was to start the install batch script with a 60 second delay (pinging a non-existant address). Otherwise the install would fail because the uninstall hadn't finished.

I found that even if I split the Install part into a whole separate task, that both tasks started concurrently. 

Is this how the KScripting is supposed to work? My impression was that each step or task would wait for the previous step to finish. 

0 Comments   [ - ] Hide Comments


Please log in to comment

Answer this question or Comment on this question for clarity



You'll notice "On Success" you are having it launch three scripts all at once; in other words "Kbox, on success I want you to do tasks 1 through 5". If invis.vbs hides everything that is executed from that script you could have one batch file doing all three of those tasks with a "start /wait" command on each line, otherwise your sleep method would be the best course of action.

Doesn't the Skype installer uninstall old versions? It seems that just using the /qn switch on the MSI would do what you wanted.

Answered 04/27/2012 by: mpace
Red Belt

  • the Skype documentation indicated that it should uninstall the old version, but that is not what I found. It through me a "must uninstall old version" error and then exited.

    I found that even if I split the "install" part up into a whole new task (Task 1: Uninstall, Task 2: Install) it wouldn't wait for the first task to finish.
Please log in to comment

Since your just calling bat files and vbs you might want to try shell scripts. I think this will give you the result your after.

Answered 04/27/2012 by: dchristian
Red Belt

  • the shell scripts result in a blank cmd window sitting there, begging for the user to close it
Please log in to comment

I usually call all my batch files from a singular run batch file. I will call all child batch files with the start /wait option to make sure the batch file has run before the next step starts

Answered 05/16/2012 by: alsmith
Senior Yellow Belt

Please log in to comment