以下是我搜集的一些提示框,制作方法是复制代码到记事本中,再另存为 vbs 文件即可,例如复制 Msgbox "您好,欢迎您!" 到记事本,另存为“提示.vbs”,双击或用命令调用此文件即可弹出消息框。
'最简单的提示框
Msgbox "您好,欢迎您!"
'增加标题信息的提示框
Msgbox " 您好,欢迎您! ",,"提示"
'带有信息图标的提示框
MsgBox "安装完成! ", vbInformation, "提示"
'带有警告图标的提示框
Msgbox "你将执行危险操作! ", VbExclamation, "警告!"
'错误报告提示框
Msgbox "操作失败! ", VbCritical, "错误!"
'带有问号的提示框
Msgbox "你将继续进行下去吗? ", VbQuestion, "提示"
'具有超时自动退出的提示框
set objShell = CreateObject("Wscript.Shell")
intReturn = objShell.Popup("此提示框在5秒后自动退出!", 5, "友情提示")
'具有自杀功能的消息框(假设以下脚本名为 OK.vbs )
MsgBox "安装完成! ", vbInformation, "提示"
set fso=wscript.createobject("scripting.filesystemobject")
fso.deletefile "ok.vbs"
'每1小时出现一次的定时提示框
'想测试效果把 (1000*60*60) 改为 (1000) 即延时1秒
WScript.Sleep (1000*60*60) '延时1小时
Msgbox "你已经使用电脑1个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑2个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑3个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑4个小时了,请注意休息!", VbExclamation, "阿细工作室最后提醒您!"
'在定时提示框中增加弹出关机菜单
WScript.Sleep (1000*60*60) '延时1小时
Msgbox "你已经使用电脑1个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑2个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑3个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑4个小时了,请注意休息! 点击确定后准备关机。", VbExclamation, "阿细工作室最后提醒您!"
Dim Shutdown
Set Shutdown=WScript.CreateObject("Shell.Application")
Shutdown.ShutdownWindows
'另一种定时提醒框
set WshShell = WScript.CreateObject("WScript.Shell")
alerttitle = "阿细工作室提提您!"
'其中vbnewline为换行符
alerttext = vbnewline & vbnewline & " 您已经使用电脑一个小时,为了健康着想,请注意休息!" & vbnewline & vbnewline & vbnewline & vbnewline & "(请移步至窗前,闭目养神,然后望下远景、活动下胳膊、脖子、腰部)"& vbnewline
for i = 1 to 8 '提醒8次
WScript.Sleep (1000*60*60) '每隔1小时提醒一次
msgbox alerttext,4096,alerttitle
'每次提示框被关闭后播放一段声响
strSoundFile = "C:\Windows\Media\Notify.wav"
Set objShell = CreateObject("Wscript.Shell")
strCommand = "sndrec32 /play /close " & chr(34) & strSoundFile & chr(34)
objShell.Run strCommand, 0, True
next
'经过8次提醒后弹出关机菜单
Dim Shutdown
Set Shutdown=WScript.CreateObject("Shell.Application")
Shutdown.ShutdownWindows
'带有选择功能的提示框
intAnswer = Msgbox("你想删除这些文件吗?", vbYesNo, "提示")
If intAnswer = vbYes Then
Msgbox "您选择了“是”",,"测试"
Else
Msgbox "您选择了“否”",,"测试"
End If
'能隐藏启动DOS命令的选择框
Set objShell = CreateObject ("Wscript.Shell")
intAnswer = Msgbox(" 你想清除系统中的临时文件吗? ", vbYesNo, "提示")
If intAnswer = vbYes Then
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.tmp"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*._mp"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.gid"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.chk"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.old"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\recycled\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %windir%\*.bak"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %windir%\prefetch\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %windir%\temp\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/q %userprofile%\recent\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\Local Settings\Temporary Internet Files\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %temp%\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\Local Settings\Temp\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\recent\*.*"),0 ,TRUE
Msgbox "已经清除系统中的临时文件!", VbInformation, "提示"
Else
End If
'密码输入对话提示框
dim a,ctr
ctr=0 '设置计数器
const pass="password" '设置密码
do
if ctr=3 then
msgbox("你已经输入三次,程序将关闭!")
exit do
else
a=inputbox("请输入密码(你有三次机会):","密码输入器")
if a=pass then
msgbox "密码正确,可以打开文件夹!"
Set objShell = CreateObject ("Wscript.Shell")
objShell.Run("explorer.exe %windir%\system32"),1 ,TRUE
if err = 0 then
End If
exit do
else
ctr=ctr+1 '如果密码出错就增加一次错误认证计数
msgbox("输入错误密码,请重新输入!")
end if
end if
loop
(修改说明:已经删除在 中的两条在执行后造成不便的命令)
[ Last edited by axi on 2007-4-14 at 01:30 PM ]
'最简单的提示框
Msgbox "您好,欢迎您!"
'增加标题信息的提示框
Msgbox " 您好,欢迎您! ",,"提示"
'带有信息图标的提示框
MsgBox "安装完成! ", vbInformation, "提示"
'带有警告图标的提示框
Msgbox "你将执行危险操作! ", VbExclamation, "警告!"
'错误报告提示框
Msgbox "操作失败! ", VbCritical, "错误!"
'带有问号的提示框
Msgbox "你将继续进行下去吗? ", VbQuestion, "提示"
'具有超时自动退出的提示框
set objShell = CreateObject("Wscript.Shell")
intReturn = objShell.Popup("此提示框在5秒后自动退出!", 5, "友情提示")
'具有自杀功能的消息框(假设以下脚本名为 OK.vbs )
MsgBox "安装完成! ", vbInformation, "提示"
set fso=wscript.createobject("scripting.filesystemobject")
fso.deletefile "ok.vbs"
'每1小时出现一次的定时提示框
'想测试效果把 (1000*60*60) 改为 (1000) 即延时1秒
WScript.Sleep (1000*60*60) '延时1小时
Msgbox "你已经使用电脑1个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑2个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑3个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑4个小时了,请注意休息!", VbExclamation, "阿细工作室最后提醒您!"
'在定时提示框中增加弹出关机菜单
WScript.Sleep (1000*60*60) '延时1小时
Msgbox "你已经使用电脑1个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑2个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑3个小时了,请注意休息!", VbExclamation, "阿细工作室提提您!"
WScript.Sleep (1000*60*60)
Msgbox "你已经使用电脑4个小时了,请注意休息! 点击确定后准备关机。", VbExclamation, "阿细工作室最后提醒您!"
Dim Shutdown
Set Shutdown=WScript.CreateObject("Shell.Application")
Shutdown.ShutdownWindows
'另一种定时提醒框
set WshShell = WScript.CreateObject("WScript.Shell")
alerttitle = "阿细工作室提提您!"
'其中vbnewline为换行符
alerttext = vbnewline & vbnewline & " 您已经使用电脑一个小时,为了健康着想,请注意休息!" & vbnewline & vbnewline & vbnewline & vbnewline & "(请移步至窗前,闭目养神,然后望下远景、活动下胳膊、脖子、腰部)"& vbnewline
for i = 1 to 8 '提醒8次
WScript.Sleep (1000*60*60) '每隔1小时提醒一次
msgbox alerttext,4096,alerttitle
'每次提示框被关闭后播放一段声响
strSoundFile = "C:\Windows\Media\Notify.wav"
Set objShell = CreateObject("Wscript.Shell")
strCommand = "sndrec32 /play /close " & chr(34) & strSoundFile & chr(34)
objShell.Run strCommand, 0, True
next
'经过8次提醒后弹出关机菜单
Dim Shutdown
Set Shutdown=WScript.CreateObject("Shell.Application")
Shutdown.ShutdownWindows
'带有选择功能的提示框
intAnswer = Msgbox("你想删除这些文件吗?", vbYesNo, "提示")
If intAnswer = vbYes Then
Msgbox "您选择了“是”",,"测试"
Else
Msgbox "您选择了“否”",,"测试"
End If
'能隐藏启动DOS命令的选择框
Set objShell = CreateObject ("Wscript.Shell")
intAnswer = Msgbox(" 你想清除系统中的临时文件吗? ", vbYesNo, "提示")
If intAnswer = vbYes Then
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.tmp"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*._mp"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.gid"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.chk"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.old"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\recycled\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %windir%\*.bak"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %windir%\prefetch\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %windir%\temp\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/q %userprofile%\recent\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\Local Settings\Temporary Internet Files\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %temp%\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\Local Settings\Temp\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\recent\*.*"),0 ,TRUE
Msgbox "已经清除系统中的临时文件!", VbInformation, "提示"
Else
End If
'密码输入对话提示框
dim a,ctr
ctr=0 '设置计数器
const pass="password" '设置密码
do
if ctr=3 then
msgbox("你已经输入三次,程序将关闭!")
exit do
else
a=inputbox("请输入密码(你有三次机会):","密码输入器")
if a=pass then
msgbox "密码正确,可以打开文件夹!"
Set objShell = CreateObject ("Wscript.Shell")
objShell.Run("explorer.exe %windir%\system32"),1 ,TRUE
if err = 0 then
End If
exit do
else
ctr=ctr+1 '如果密码出错就增加一次错误认证计数
msgbox("输入错误密码,请重新输入!")
end if
end if
loop
(修改说明:已经删除在 中的两条在执行后造成不便的命令)
[ Last edited by axi on 2007-4-14 at 01:30 PM ]
本帖最近评分记录
(共 3 条)
点击查看详情
| 评分人 | 分数 | 时间 |
|---|---|---|
| lxmxn | +6 | 2007-03-13 02:08 |
| zhxy9804 | +2 | 2007-03-14 22:24 |
| hy433124shc | +2 | 2007-03-17 11:10 |

