Vbs talking to batch

Microsoft Windows xp home sp2
November 21, 2009 at 11:22:49
Specs: Windows XP
Hey everybody im looking for a vbs script to open a popup message, and when a certain button is clicked it will tell the batch file to do something.
(example: -batch file is open- -vbs file opens popup window- I click cancel. The vbs file tells the OPEN batch file to exit.)

this is the code i have right now:
Dim answer
answer=MsgBox("Hello everyone!",2,"Flash forward")

See More: Vbs talking to batch

Report •

November 22, 2009 at 01:40:30
You might want to look at the Sendkeys function. It is likely to be the only thing that will work. Sendkeys sends key presses to the other function as if they had come from the keyboard.


Report •

November 22, 2009 at 05:50:35
I click cancel.
That's going to be difficult; 1, 3, and 5 have a Cancel button; you picked vbAbortRetryIgnore

@echo WScript.Quit MsgBox("Hello everyone!", vbOKCancel, "Flash forward") = vbCancel > #.vbs
@#.vbs || goto end
@echo Didn't hit Cancel
@del #.vbs

Report •

November 22, 2009 at 08:17:03
Thanks for the code, can you explain it please. Also, I would like to batch file to goto a certain area of the batch file if someone clicks ok on it.

Report •

Related Solutions

November 23, 2009 at 15:27:35

Exit script, returning the specified errorlevel

MsgBox("Hello everyone!", vbOKCancel, "Flash forward") = vbCancel

Compare the results of the dialog w/ vbCancel.Returns "True" (-1) if the user clicked "Cancel," or "False" (0) if not.

@#.vbs || goto end

Run the script; if the errorlevel is not 0, goto end.

@echo Didn't hit Cancel

Code area that runs if the user didn't hit "Cancel"

@del #.vbs


Report •

November 24, 2009 at 02:54:02
<warning type="thread-hijack" detail="off-topic rant">
I wish it were possible to run VBScript without having to create a file first.

Report •

Ask Question