VB script for XP doesn't work in VISTA

  • Thread starter Thread starter Billericay Pete
  • Start date Start date
B

Billericay Pete

A kind soul kindly sent me this script which gives an audible alert when a
chat window opens on my PC.
It doesn't work on VISTA any ideas as to what needs to be changed?

set shell=createobject("wscript.shell")
while NOT shell.appactivate("Private Chat")
wscript.sleep 2000
wend
shell.run "c:/windows/media/tada.wav"
wscript.quit



Thanks
Pete
 
A kind soul kindly sent me this script which gives an audible alert when a
chat window opens on my PC.
It doesn't work on VISTA any ideas as to what needs to be changed?

set shell=createobject("wscript.shell")
while NOT shell.appactivate("Private Chat")
wscript.sleep 2000
wend
shell.run "c:/windows/media/tada.wav"
wscript.quit

Thanks
Pete

what sort of errors are you getting?

Does it work on Windows XP ?
 
It worked fine on XP - just doesn't do anything on vista - no errors - just
doesn't work....
thanks
Pete
 
Does wscript show as a process in task manager? Does
c:/windows/media/tada.wav work from the Run line?
 
Hi Mark - I had a feeling that it may have been you who wrote the script
some years ago...
I ran it again, and in fact it did give a compilation error - 'line 5 char
1 - expected statement.'
I think I may have played around with it as it didn't work (and now messed
it up completely!)
c:/windows/media/tada.wav does work from the command line.

Thanks
Pete
 
Does wscript show as a process in task manager? Does
c:/windows/media/tada.wav work from the Run line?

--

Is the private chat window called Private Chat in Vista?
 
--Private Chat.VBS--
set shell=createobject("wscript.shell")
while NOT shell.appactivate("Private Chat")
wscript.sleep 5000
wend

shell.run "wmplayer.exe" & " /Play c:/windows/media/tada.wav"
wscript.sleep 2000
shell.run "taskkill /IM wmplayer.exe"

wscript.quit
--end file--
Save this as "Private Chat.VBS", and keep notepad open while you run the
test, to give it a window with "Private Chat' in it.
 
Thanks Mark - you're a star!!
Pete

Mark L. Ferguson said:
--Private Chat.VBS--
set shell=createobject("wscript.shell")
while NOT shell.appactivate("Private Chat")
wscript.sleep 5000
wend

shell.run "wmplayer.exe" & " /Play c:/windows/media/tada.wav"
wscript.sleep 2000
shell.run "taskkill /IM wmplayer.exe"

wscript.quit
--end file--
Save this as "Private Chat.VBS", and keep notepad open while you run the
test, to give it a window with "Private Chat' in it.

--
click the Ratings button. Voting helps the web interface.
http://www.microsoft.com/wn3/locales/help/help_en-us.htm see ''rate a
post''
Mark L. Ferguson
 
Back
Top