{"id":71723,"date":"2004-08-04T14:21:00","date_gmt":"2004-08-04T14:21:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2004\/08\/04\/how-do-i-change-the-title-of-a-message-box\/"},"modified":"2004-08-04T14:21:00","modified_gmt":"2004-08-04T14:21:00","slug":"how-do-i-change-the-title-of-a-message-box","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/how-do-i-change-the-title-of-a-message-box\/","title":{"rendered":"How Do I Change the Title of a Message Box?"},"content":{"rendered":"<p><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\"><\/p>\n<p>Hey, Scripting Guy! Whenever I use a message box, the caption reads <b>Windows Script Host<\/b>. Is there any way to change that caption?<\/p>\n<p>&#8212; TT, Reno, NV <\/p>\n<p><img decoding=\"async\" border=\"0\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" height=\"5\"><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\"><a href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><img decoding=\"async\" class=\"farGraphic\" title=\"Script Center\" border=\"0\" alt=\"Script Center\" align=\"right\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" height=\"288\"><\/a><\/p>\n<p>Hey, TT. To answer your question, no, not if you\u2019re using Wscript.Echo; in that case, you\u2019re stuck with the caption Windows Script Host. However, you <i>can<\/i> create a custom caption using the VBScript Msgbox function. For example:<\/p>\n<pre class=\"codeSample\">strMessage = \"Here is my message.\"\nMsgbox strMessage, 0, \"This is my message box\"\n<\/pre>\n<p>In this sample script, we\u2019re passing three parameters to the Msgbox function:<\/p>\n<table id=\"EBD\" class=\"dataTable\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\"><b>strMessage<\/b><\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">This is simply a variable that contains the message we want to display.<\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\"><b>0<\/b><\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">This value indicates that the message box should only have an OK button. By passing different values, you can display message boxes that have Yes and No buttons, message boxes that have Abort, Retry, Ignore buttons, etc.<\/p>\n<\/td>\n<\/tr>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\"><b>\u201cThis is my message box.\u201d<\/b><\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">This is the custom caption you want displayed on your message box.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>There\u2019s one important thing to keep in mind here. When you use Wscript.Echo, your messages are displayed in a message box only if you are running under Wscript; if you are running under CScript messages are echoed to the command windows instead. With the Msgbox function, messages are <i>always<\/i> displayed in message boxes, regardless of which script host you are using.<\/p>\n<p>For more information about modifying message box parameters, see the <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/script56\/html\/vsfctMsgBox.asp\" target=\"_blank\">VBScript documentation<\/a> on MSDN.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! Whenever I use a message box, the caption reads Windows Script Host. Is there any way to change that caption? &#8212; TT, Reno, NV Hey, TT. To answer your question, no, not if you\u2019re using Wscript.Echo; in that case, you\u2019re stuck with the caption Windows Script Host. However, you can create a [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25,3,4,5],"class_list":["post-71723","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-displaying-output","tag-scripting-guy","tag-scripting-techniques","tag-vbscript"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! Whenever I use a message box, the caption reads Windows Script Host. Is there any way to change that caption? &#8212; TT, Reno, NV Hey, TT. To answer your question, no, not if you\u2019re using Wscript.Echo; in that case, you\u2019re stuck with the caption Windows Script Host. However, you can create a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/71723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=71723"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/71723\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=71723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=71723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=71723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}