If you are unable to create a new account, please email bspsoftware@techdata.com

Author Topic: Batch File - Pop up window  (Read 10865 times)

Offline pricter

  • Statesman
  • ******
  • Join Date: Feb 2006
  • Posts: 264
  • Forum Citizenship: +26/-0
Batch File - Pop up window
« on: 18 Jul 2012 06:32:35 am »
Hi to all,

I want to create a batch file in which the user will select to continue the process through a pop up window yes or no.

I know about the
Code: [Select]
SET /P ANSWER=Do you want to continue (Y/N)?but this does not create a pop up window.

Any suggestions?

Offline nmcdermaid

  • Senior Consultant
  • Community Leader
  • *****
  • Join Date: Apr 2010
  • Posts: 76
  • Forum Citizenship: +1/-0
Re: Batch File - Pop up window
« Reply #1 on: 21 Jan 2013 09:01:57 pm »
You can't create a pop up window from a batch file. The easiest way is probably using VBScript. You can use a piece of VBScript to pop up a question like that but the difficult part is sending the reply back to DOS.

For example, open up notepad, paste this in and save the file as question.VBS

Now double click it to see what it does.

Code: [Select]
Dim iResult
iResult = msgbox("A question",4)
call msgbox("return code is " & iResult)

To call this from a batch file you use something like this:

Code: [Select]
wscript <path to your VBS file>
Post back if you would like more help.