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.
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.
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.
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.
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:
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.
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.
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