Anyone able to help with a VBS script please?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

martinlest

Thread Starter
Joined
Nov 11, 2010
Messages
153
I'd be grateful if any VBS 'guru' could advise! I have a messagebox script to run a programme, which is fine. But I am hardly an expert here and this is as far as I can get. What I am trying to achieve is for the message box to time out after say ten seconds if no manual choice is made, the box to close and the exe file to run (ie. default to the 'yes' option). Nothing I've tried works.

I am out of my depth with this, so help appreciated,

Thanks,

Martin

-------------------------------------------------

intAnswer = _
Msgbox(" Do you want to run FS9?", _
vbYesNo, " ")

If intAnswer = vbYes Then

Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""D:\FS9\fs9.exe""")
Set objShell = Nothing

Else

End If
 

martinlest

Thread Starter
Joined
Nov 11, 2010
Messages
153
It's OK, this script works (popup method).. Thanks to 59Cobalt at VBS forum...

Set sh = CreateObject("WScript.Shell")
answer = sh.Popup("Do you want to run FS9?", 10, "Title", vbYesNo)
If answer = vbYes Or answer = -1 Then
sh.Run "D:\FS9\fs9.exe"
End If
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top