Script for closing Skype Window on startup

To be filled by o.e.m. / To be filled by o.e.m.
August 31, 2011 at 07:58:29
Specs: Microsoft Windows XP Home Edition, 2.2 GHz / 2047 MB
Skype has a new "feature" (which they are not prepared to change) whereby it opens to full Window every time the computer starts. I found the following script somewhere on the net, which apparently closes the Window automatically, leaving Skype running in the background:

const sWindowTitle = "Skype"
dim sh
dim notReady
set sh = createobject("")
notReady = true
while notReady
if sh.appactivate(sWindowTitle) then
wscript.sleep 250
sh.sendkeys "%A"
sh.sendkeys "%{F4}"
notReady = false
wscript.sleep 1000
end if
set sh = nothing

This vbs file works perfectly on my nicely honed and fast XP but fails on my sluggish Vista. I have been trying various figures in place of the 250 and 1000, assuming this to be a timing issue due to bootup and/or Skype. I'm rubbish at scripting so it would help my "trial and error" if anyone can explain what these two figures are actually doing. At the worst I would know more quickly when it is time to give up.

That is the main question but obviously if anyone can improve this script (maybe reducing the timing dependancy) then that would be more than welcome.


See More: Script for closing Skype Window on startup

Report •

August 31, 2011 at 18:43:45
Let me try to answer my own question:

1. If Skype is activated, 250 millseconds later it closes the Skype Window.

2. If Skype has not activated it waits 1000 milliseconds then repeats the process,
(ie waiting 250 milliseconds...etc).

Is that right folks?

Report •

September 1, 2011 at 07:18:07
Basically, yes. But it sends Alt-A, Alt-F4. Not exactly the same thing. I'm not sure what the Alt-A is supposed to do, but there you go.

Also, have some suggested reading: Vista's startup box.

How To Ask Questions The Smart Way

Report •

September 1, 2011 at 08:59:29

Yes, Alt-F4 is understood but I've no idea what the "%A" line means either.

Thank you for your general confirmation and the link provided, both of which are very useful.

I still can't make this work on Vista, sometimes it does but next time it fails. Anyhow I've more info to go on now, so will play around and if I sort it out I'll pop back.

Thanks again - much appreciated.

Always pop back and let us know the outcome - thanks

Report •

Related Solutions

Ask Question