Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Can I bypass MsgBox ?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,37044
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Can I bypass MsgBox ?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Can I bypass MsgBox ? - 8/16/2006 2:41:06 PM   
  netxman

 

Posts: 104
Score: 0
Joined: 8/1/2005
Status: offline
 
For example.

I want to msgbox a warning dialog box then reboot the computer after 1 minute. But if user do not click OK the computer will not countdown and not reboot.

Use objShell.PopUp can let the msgbox auto click but I still want user see the warning box.

Really want to know if there is a way to do next step when the msgbox still on the screen.

Thank you.
 
 
Post #: 1
 
 RE: Can I bypass MsgBox ? - 8/16/2006 11:37:37 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
if the computer is going to reboot where would the message box display after popup times out?

You could also check out shutdown.exe which should be on all Windows 2000/XP machines.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to netxman)
 
 
Post #: 2
 
 RE: Can I bypass MsgBox ? - 8/17/2006 1:58:20 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
NetXMan,

Will this work for you?



msgResult = MsgBox("Click OK to reboot, or Cancel to quit",4097) 'using VBSystemModal (4096) and VBOKCancel(1) = 4096 + 1

If (msgResult = 1) Then 'user clicked OK
MsgBox "Clicked OK, thank you, will reboot now.",64
'start reboot sequence in 1 minute
Else
MsgBox "Clicked Cancel, thank you, will terminate script, and NOT reboot",64
Wscript.Quit
End If


_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to mbouchard)
 
 
Post #: 3
 
 RE: Can I bypass MsgBox ? - 8/17/2006 2:17:41 AM   
  Country73


Posts: 732
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
You may want to take a look at the WSH Documents for the use of POPUPS.

Here is some sample code to show how you may be able to use this in your situation:


      

(in reply to netxman)
 
 
Post #: 4
 
 RE: Can I bypass MsgBox ? - 8/23/2006 1:11:38 PM   
  netxman

 

Posts: 104
Score: 0
Joined: 8/1/2005
Status: offline
Thanks very much you five stars men.

I think I didn't give the exact expression to you all. Sorry for my bad english.

Your scripts are both excellent but have a little difference from what I want.

Well, I just want when the popup window popped up, the counter would start its work at the same time whether user click OK or not. The status now is that if user doesn't click OK button, the counter will not work so the reboot action will not start.

This is only a example. In other words, do we have a way to go on running the script when the pop up window still stay on the screen?

==========================================
msgbox "Keep this window"

objShell.run "cmd.exe /c net user administrator 123456"
==========================================

How to let the second line run and keep the first line's window?

Thanks.

(in reply to netxman)
 
 
Post #: 5
 
 RE: Can I bypass MsgBox ? - 8/23/2006 8:02:32 PM   
  coldstrongvision

 

Posts: 14
Score: 0
Joined: 8/14/2006
Status: offline
quote:

ORIGINAL: netxman

Well, I just want when the popup window popped up, the counter would start its work at the same time whether user click OK or not. The status now is that if user doesn't click OK button, the counter will not work so the reboot action will not start.


So, whats wrong with Country73's code? It displays a popup that vanishes after a period of time and due to the "action handler" you can set up actions carried out at certain events. You only have to replace the Echo-statements with your reboot action...

quote:

ORIGINAL: netxman
This is only a example. In other words, do we have a way to go on running the script when the pop up window still stay on the screen?
==========================================
msgbox "Keep this window"

objShell.run "cmd.exe /c net user administrator 123456"
==========================================


Hm...I guess you can do it due to the Event-based structure of Windows. Perhaps you can catch some kind of Event and react to it...very strange stuff with VBscript (I'm not sure wether you can do it all using VBscript)

perhaps go from here

< Message edited by coldstrongvision -- 8/23/2006 8:06:01 PM >

(in reply to netxman)
 
 
Post #: 6
 
 RE: Can I bypass MsgBox ? - 8/23/2006 11:54:53 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
You can take Country's script 1 step further and add a second pop up. 


      

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to coldstrongvision)
 
 
Post #: 7
 
 RE: Can I bypass MsgBox ? - 8/24/2006 12:12:39 AM   
  Country73


Posts: 732
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
I believe, which I may not be understanding netxman correctly, but it sounds like the script will pop up the msgbox but the script needs to keep running through and not waiting for a response to the pop up message.

This sounds more like a combination of two scripts running.

I may be wrong on this, but that's what I got out of netxman's last post.

(in reply to mbouchard)
 
 
Post #: 8
 
 RE: Can I bypass MsgBox ? - 8/24/2006 12:49:05 AM   
  ebgreen


Posts: 4970
Score: 31
Joined: 7/12/2005
Status: offline
That is the impression I get as well. If that is the case then 2 scripts would work as a solution. You could also use IE to display the information to the user instead of a MsgBox.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Country73)
 
 
Post #: 9
 
 RE: Can I bypass MsgBox ? - 8/31/2006 3:50:09 PM   
  netxman

 

Posts: 104
Score: 0
Joined: 8/1/2005
Status: offline
Yes Country73, you are right.

Thanks all upstairs.

Maybe it can not come to true in one script.Two scripts are very easy to do that.

Thanks coldstrongvision, I think Wscript.Echo is not the same as MsgBox especially in console.

Thank you very much.

(in reply to ebgreen)
 
 
Post #: 10
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Can I bypass MsgBox ? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts