Scripting With Notepad-New question- Help is APPRECIATED!
Anyone who is good at scripting, Help.
Thursday, December 20, 2007 by Bugsbunny500 | Discussion: Personal Computing
Edit:
Thanks for the help. But now I now I want to make it so i can Start a program in the middle of messageboxes. Theorictally, it should be something like this:
- msgbox "Hi, I'm gonna start the command prompt for you"
- start cmd
But that doesnt work?
I also downloaded that micrsoft thing you told me too. The help window says the action has been cancelled.
Reply #2 Thursday, December 20, 2007 9:46 PM
- msg = Msgbox("Question", vbyesno)
- If msg = vbyes Then
- msgbox "Correct"
- Else
- msgbox "Incorrect!"
- End If
Just throwin' it out there.
Reply #3 Thursday, December 20, 2007 9:51 PM
I don't remember either; so, you're still ahead of me!
SirSmiley /huggles the WSH help file.
Oh, almost forgot change the 67 to just 4 to limit the msgbox to yes/no.
Reply #5 Friday, December 21, 2007 12:34 AM
That's a little trickier, and I'd like to know the answer to that as well. In my user experience the msgbox always has to be cleared before the script continues; could be wrong.
However, if you set the prompt on a timer before you put up the msgbox it will work; won't clear the msgbox though.
Example:
- Sub Object_OnScriptEnter
- object.SetTimer 1, 5000
- msgbox "Hi, I'm gonna start the command prompt for you"
- End Sub
- Sub Object_OnTimer1
- Object.KillTimer 1 '--Kill the timer first thing!
- msgbox "Does whatever"
- End Sub
I'm getting that too.
I'm not sure what's wrong with it.Reply #6 Friday, December 21, 2007 1:01 AM
If not, ignore the above script as it only pertains to DesktopX.
Reply #7 Friday, December 21, 2007 2:07 AM
With the details you've given it's hard to suggest something. If the program you're running is not tied to the result of the message box than the simplest suggestion is to make two subs & pause the sub that runs the app.
- Call MyApp 'The app sub must be called first or the message box sub will override it
- Call MyMessages
- Sub MyMessages
- Dim MyVar
- MyVar = MsgBox ("Hello World!", 4, "MsgBox Example")
- If MyVar = 7 Then MyVar2=MsgBox("Wrong Answer!", 4, "Second Message Box")
- End Sub
- Sub MyApp
- WScript.Sleep 100 'Time in milliseconds
- Set WshShell = WScript.CreateObject("WScript.Shell")
- WshShell.Run "%windir%\notepad "
- End Sub
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Thursday, December 20, 2007 9:17 PM
WWW Link
Then look at the MsgBox Function.
Here's how to do it in vbscript. For each button you select there is an assigned number that is returned. No = 7