[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


VBScript Confirm Dialog Box

Posted on 2011-05-09
Medium Priority
Last Modified: 2012-05-11
Hi, We have one query!

I want to show the Confirm box with VBScript but the issue is!

1. The Confiorm dialog box shows the VBSCRIPT in title, that i do not need.
2. Also in the OK/Cancel i want to see the Yes/No Button.

Please guide what needs to be Done. The Application is IE Specific only

No Changes can be made to DLL or registry, Is this Progmatically possible



Expert Comment

ID: 35720444
MsgBox("Confirmation message",1,"Your own title")

Expert Comment

ID: 35720448
Sorry, switch 1 to 4 for Yes/No.
LVL 16

Author Comment

by:Gurpreet Singh Randhawa
ID: 35720756
Thanks, But it is unable to remove the VBSCRIPT:  from the confirm dialog Boc, Please check on this

i want to remove that also!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

edemcs earned 2000 total points
ID: 35720874
This is set by  to distinguish it from a system message.  Unless you write a com or active x object, you won't be able to remove it.  The easiest solution is to include javascript on your page and use its confirm modal.  This will not contain that message in the title bar.
LVL 16

Author Comment

by:Gurpreet Singh Randhawa
ID: 35720971
there must be some way

Expert Comment

ID: 35721587
Use Javascript "confirm" or "alert":

LVL 16

Author Comment

by:Gurpreet Singh Randhawa
ID: 35722680
na! VBscript preferred i told in my post
LVL 65

Expert Comment

ID: 35726085
Hi, you need to MsgBox, as opposed to WScript.Echo

intReturn = MsgBox("This is your prompt", vbYesNo, "This is your title")


LVL 16

Author Comment

by:Gurpreet Singh Randhawa
ID: 35727058
I do not know but i have told in my post that i do not want the title VBSCRIPT to appear,
LVL 13

Expert Comment

ID: 35727421
I guess you are using MsgBox in an HTML page via Internet Explorer.

edemcs was telling you the truth.  You cannot stop the VBScript: prefix to the title.  The only way to not have the VBScript: prefix in the title when calling a message box from an HTML page is to generate a messagebox not using VBScript code in your web page.

As both edemcs and Dhugal_L advised, you can use Javascript instead, but then the message box will have "Message from webpage" in the title.  (more on Javascript message boxes: http://www.w3schools.com/JS/js_popup.asp).   Try sample below:

There will be two message boxes, one using vbScript and one using Javascript.

<script type="text/vbscript">
MsgBox "Message using VBScript", vbYesNo + vbQuestion, "Title baby"

<script type="text/javascript">
confirm("Message using Javascript");


Open in new window

So: You either use one of the methods to generate a basic message box as suggested by posters above, or use a more complex popup method to generate a custom one exactly to your taste:
   Example 1:  http://www.htmlcodetutorial.com/linking/linking_famsupp_72.html
   Example 2:  http://msdn.microsoft.com/en-us/library/ms533025(v=vs.85).aspx

Good luck,

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question