China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-05 04:19
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Who can help list the kinds of VBS pop-up boxes? [Solved] View 1,546 Replies 11
Original Poster Posted 2007-04-29 00:52 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
Who can help list the kinds of VBS pop-up boxes? Please help list them for me. Thanks

[ Last edited by heicai on 2007-6-29 at 07:49 PM ]
Floor 2 Posted 2007-04-29 00:55 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
What's the shortest code to pop up that kind of dialog box with only an OK button?
Floor 3 Posted 2007-04-29 01:16 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
msgbox("Hello")
Floor 4 Posted 2007-04-29 01:22 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
How do you add a title???
Floor 5 Posted 2007-04-29 01:22 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
Can it be used in bat and cmd?
Floor 6 Posted 2007-04-29 01:28 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
heicai +2 2007-04-29 01:32
Floor 7 Posted 2007-04-29 01:33 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
So that means you can't pop up a box directly in BAT?? Some antivirus software may give false positives when generating vbs.
Floor 8 Posted 2007-04-29 01:36 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
I use Kaspersky
I found that as long as vbs doesn't operate on files/the registry and so on, it won't be detected by antivirus software.
Floor 9 Posted 2007-04-29 01:58 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
Thanks for the explanation!
Floor 10 Posted 2007-04-29 04:01 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Remember to search.

mshta vbscript:msgbox("OK",vbyesno+vbquestion,"Hello")(window.close)
Floor 11 Posted 2007-06-29 19:28 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
Let me ask, can this kind of pop-up box as shown in the picture be imitated with VBS??
Attachments
1.JPG
Floor 12 Posted 2007-06-29 19:48 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
I've already found the relevant materials. Sharing them with everyone as well.


How to use msgbox

Description
Displays a message in a dialog box, waits for the user to click a button, and returns a value indicating which button the user clicked.
Syntax
MsgBox(prompt[, buttons][, title][, helpfile, context])
The MsgBox function syntax has the following parameters:

Parameter Description
prompt A string expression displayed as the message in the dialog box. The maximum length of prompt is about 1024 characters, depending on the width of the characters used. If prompt contains multiple lines, the lines can be separated with a carriage return (Chr(13)), a line feed (Chr(10)), or a carriage return/line feed combination (Chr(13) & Chr(10)).
buttons A numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the message box modality. For the values, see the "Settings" section. If omitted, the default value for buttons is 0.
title A string expression displayed in the title bar of the dialog box. If title is omitted, the application name is displayed in the title bar.
helpfile A string expression identifying the help file used to provide context-sensitive Help for the dialog box. If helpfile is provided, context must also be provided. Not available on 16-bit system platforms.
context A numeric expression identifying the Help context number assigned to a help topic by the help file author. If context is provided, helpfile must also be provided. Not available on 16-bit system platforms.



Settings
The buttons argument can have the following values:
Constant Value Description
vbOKOnly 0 Displays the OK button only.
vbOKCancel 1 Displays OK and Cancel buttons.
vbAbortRetryIgnore 2 Displays Abort, Retry, and Ignore buttons.
vbYesNoCancel 3 Displays Yes, No, and Cancel buttons.
vbYesNo 4 Displays Yes and No buttons.
vbRetryCancel 5 Displays Retry and Cancel buttons.
vbCritical 16 Displays the Critical Message icon.
vbQuestion 32 Displays the Warning Query icon.
vbExclamation 48 Displays the Warning Message icon.
vbInformation 64 Displays the Information Message icon.
vbDefaultButton1 0 The first button is the default.
vbDefaultButton2 256 The second button is the default.
vbDefaultButton3 512 The third button is the default.
vbDefaultButton4 768 The fourth button is the default.
vbApplicationModal 0 Application modal: the user must respond to the message box before continuing work in the current application.
vbSystemModal 4096 System modal: all applications are suspended until the user responds to the message box.


The first group of values (0 - 5) describes the type and number of buttons displayed in the dialog box; the second group of values (16, 32, 48, 64) describes the icon style; the third group of values (0, 256, 512) determines the default button; and the fourth group of values (0, 4096) determines the message box modality. When adding these numbers to generate the value of the buttons argument, only one number may be taken from each group.

Return values
The MsgBox function has the following return values:
Constant Value Button
vbOK 1 OK
vbCancel 2 Cancel
vbAbort 3 Abort
vbRetry 4 Retry
vbIgnore 5 Ignore
vbYes 6 Yes
vbNo 7 No
Forum Jump: