Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Execute now button

Original Message
Name: Nath5
Date: November 26, 2007 at 13:12:15 Pacific
Subject: Execute now button
OS: 11
CPU/Ram: 11
Model/Manufacturer: 11
Comment:
I have a batch file that acts as a timer and when the time reaches zero it starts another file. I would like to know if there is a way to create either a batch or vbs script to provide a menu which would allow the user to execute the program at any point durring the count down, through the use of an execute now button.

Report Offensive Message For Removal


Response Number 1
Name: Nath5
Date: November 26, 2007 at 16:16:36 Pacific
Subject: Execute now button
Reply: (edit)
I know that i need to use some sort of VB script and i have taken several suggestions an was able to make a message box appear using the following code

MsgBox CreateObject("WScript.Shell").Popup("I see you", 10, "ICU", 49)

I noticed that the box returns a specific number for each response but i am not sure how to get the response to a variable and then be able to send the parameter back to the main batch file that is driving the program. Also if possible i would like to have only one button that says Execute Now.


Report Offensive Follow Up For Removal

Response Number 2
Name: Razor2.3
Date: November 26, 2007 at 19:41:26 Pacific
Subject: Execute now button
Reply: (edit)
If you're just waiting, and you don't want to give the option to cancle?
CreateObject("WScript.Shell").Popup "Execute Now", 10, "Execute Now", 48
or
CreateObject("WScript.Shell").Popup "Execute Now", 10, "Execute Now"

On an unrelated note, [pre] works now.


Report Offensive Follow Up For Removal

Response Number 3
Name: Nath5
Date: November 26, 2007 at 21:34:03 Pacific
Subject: Execute now button
Reply: (edit)
I have that code but i am unsure of how to capture the action of the button being pressed and use it is the batch file. I know that the code above returns a value but how do i get the value back to the batch and how do i have the batch check the value.

Report Offensive Follow Up For Removal

Response Number 4
Name: Razor2.3
Date: November 26, 2007 at 21:50:48 Pacific
Subject: Execute now button
Reply: (edit)
Does it matter? Granted, you've been rather vauge about what you want to happen, but from what I've gathered, the rest of the script WILL run, regardless if the timer runs out or the user hits the button.

Still, if you want/need to know:

WScript.Quit CreateObject("WScript.Shell").Popup("Execute Now", 10, "Execute Now") = -1
Then, all you have to do is check the %ErrorLevel%; 0 means the button was pressed, -1 means the timer expired. Convenient, as it allows something like this:
echo WScript.Quit CreateObject("WScript.Shell").Popup("Execute Now", 10, "Execute Now") = -1 > _.vbs
cscript //nologo _.vbs || GOTO :EOF


Report Offensive Follow Up For Removal

Response Number 5
Name: Nath5
Date: November 27, 2007 at 15:11:01 Pacific
Subject: Execute now button
Reply: (edit)
What does that second chunk of code do exactly, i know almost no vb so while i can understand some of it, much of it is lost on me. Also how would i capture the error lever as mentioned above and send it to a txt file.

Report Offensive Follow Up For Removal


Response Number 6
Name: Razor2.3
Date: November 27, 2007 at 19:07:26 Pacific
Subject: Execute now button
Reply: (edit)
You... You're not even trying, are you?

Report Offensive Follow Up For Removal

Response Number 7
Name: Nath5
Date: November 27, 2007 at 19:48:31 Pacific
Subject: Execute now button
Reply: (edit)
I am trying like i said i know next to nothing about VB and not much about batch. I am unsure of how to access the variable error level. I tried to test it using cmd to run the script you posted and then check the variable errorlevel but it does seem to work the way i thought it would. Is there a way that i could send the error level returned by the script to a text file. I am not trying to make this hard i really am trying i have looked all over the internet trying things but like i said i am not an experienced programmer. Thank you so much for all the help you have given already.

Report Offensive Follow Up For Removal

Response Number 8
Name: Razor2.3
Date: November 27, 2007 at 20:41:57 Pacific
Subject: Execute now button
Reply: (edit)
WScript.Quit
CreateObject()
Popup
= -1
cscript
hh ntcmds.chm::/ntcmds_shelloverview.htm -> ||
hh ntcmds.chm::/goto.htm -> GOTO

Those last two are commands to type in the Run box.

Learn to try.


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Execute now button

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




XP Installed to G?

exessive internet traffic

ZoneAlarm Question. Blocked Connect

Windows Live Messenger Problem

Delete $Uninstall after SP3 updates


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC