返回列表 发帖

[问题求助] [已解决]VBS如何自定义弹出对话框的样式

本帖最后由 pcl_test 于 2016-8-7 19:49 编辑

请问VBS怎么写弹出窗口?
根据123.txt内容, 如123.doc  , 弹窗提示“是否复制123.doc”, 并且有7个按钮,  假设每个按钮都是将123.doc 复制到 e:\ 。 请问则么写 ??

vbs好像可以弹出消息吧, 不知是否可行?
谢谢啦
1

评分人数

    • keen: 感谢主动给标题标注[已解决]字样PB + 2

LZ,可能是我见识短浅,暂时纯批处理还做不到,也没有相应的第三方可以完成这个功能。。。
第三方命令行工具编程
Http://Hi.Baidu.Com/Console_App

TOP

只能用InternetExplorer.Application模拟

TOP

呃……利用VB吧、可是这是批处理之家而不是VB
msgbox

TOP

7个按钮就自个画七八..
话说楼楼楼上某DEF大大不是用VBS做过全自动InternetExplorer.Application模拟的啊,给他玩玩?

TOP

xp中自带有 msg。用法参见:msg /?
_____________________版务操作_____________________

为了节省论坛版面资源和存储空间,删除了不必要的对命令帮助的全盘复制。
        —— by zqz0012005  20090817
_____________________版务操作_____________________
o(∩_∩)o...~~~
空间:http://hi.baidu.com/fair_jm
喜欢批处理的没事的话去逛逛哦~~

TOP

想制作有按扭的窗口,可以用HTA ,以下是一个示例,把以下代码复制到记事本,另存为 BrgoMenu.hta 即可。效果如图,既有背景音乐,又有活动文字说明。(以下代码中,&nbsp中的是中文字符,使用时请还原为英文的&,因为&加上nbsp的组合是表示空格,在网站上贴出来就是显示空格,不能显示此组合字,想获得如图效果,可以下载附件,其中还有子窗口代码供参考)想增加按扭或修改提示内容,可以用记事本来编辑以上代码即可。
<title>备份还原快手2.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By: newxso</title>
<SCRIPT LANGUAGE="VBScript">
window.resizeTo 473, 190
window.moveTo(screen.width-500)/2,(screen.height-400)/2
Set objShell = CreateObject ("Wscript.Shell")
Sub BackupScript
         objShell.Run("%comspec% /c start brgo.exe 1"),0 ,TRUE
Self.Close()
End Sub
Sub RestoreScript
         objShell.Run("%comspec% /c start brgo.exe 2"),0 ,TRUE
Self.Close()
End Sub
Sub BootScript
         objShell.Run("%comspec% /c start BootSet.hta"),0 ,TRUE
End Sub
Sub HddScript
      
         objShell.Run("%comspec% /c start HddInfo.hta"),0 ,TRUE
End Sub
Sub HelpScript
        objShell.Run("%comspec% /c notepad.exe 使用说明.txt"),0 ,TRUE
End Sub
</SCRIPT>
<body bgcolor="#DCDCDC">
<fieldset><legend>请用鼠标点击选择以下项目:</legend>
<td valign="top"><font color="#D200D2" size="2">
<marquee behavior="alternate" scrollamount="4">┏点击┓</marquee>
&nbsp;<input id=runbutton class="button" type="button" value="备份系统" name="backup_button"
onClick="BackupScript">
<input id=runbutton class="button" type="button" value="还原系统" name="Restore_button"
onClick="RestoreScript">
<input id=runbutton class="button" type="button" value="引导模式" name="boot_button"
onClick="BootScript">
<input id=runbutton class="button" type="button" value="磁盘信息" name="hdd_button"
onClick="HddScript">
<input id=runbutton class="button" type="button" value="使用帮助" name="help_button"
onClick="HelpScript">
<BR>
<BR>
<BR>
<td valign="top"><font color="#FF60AF" size="2">
<marquee scrollamount="2" direction="left">背景音乐: 谭咏麟 - 无法不想你</marquee>
<fieldset>
<table border="0" cellspacing="1" width="100%">
<td valign="top"><font color="#01B468" size="2">
<marquee scrollamount="4" direction="left">备份还原快手 是一个可以在Windows下完成Ghost备份还原的程序 简单到你只需点一下鼠标即可&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Made: newxso QQ:453623262 Email:aximail@126.com</marquee>
</table>
<body scroll="no">
<HTA:APPLICATION contextmenu="no" MaximizeButton="No" ICON="brgo.ico">
<BGSOUND SRC="无法不想你.wma" Loop="-1">
</BODY>COPY

TOP

vbs弹窗

wscript.Echo "vbs弹窗内容"

TOP

2L看错了。。。

如果VBS的话,可以试用下HVScript,能快速制作窗口VBS。。。
第三方命令行工具编程
Http://Hi.Baidu.Com/Console_App

TOP

本帖最后由 pcl_test 于 2016-8-7 20:50 编辑

http://www.bathome.net/redirect. ... 7540&ptid=40921
WSH.echo CreateObject("WScript.Shell").Exec("mshta.exe ""about:<hta:application showintaskbar=no />" &_
        "<title>提示</title><script>window.resizeTo(500, 150);" & _
        "function f(a){document.getElementById('info').innerText=a.value;" & _
        "new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(a.value.replace(/\D+/, ''));" & _
        "setTimeout(function(){window.close()}, 1000)}</script>" & _
        "<body style='text-align:center'><div><font style='color:#FF0000;'>点击其中一个按钮试试</font><br>" & _
        "<input type='button' value='按钮1' onclick='f(this)'>&nbsp;&nbsp;" & _
        "<input type='button' value='按钮2' onclick='f(this)'>&nbsp;&nbsp;" & _
        "<input type='button' value='按钮3' onclick='f(this)'>&nbsp;&nbsp;" & _
        "<input type='button' value='按钮4' onclick='f(this)'>&nbsp;&nbsp;" & _
        "<input type='button' value='按钮5' onclick='f(this)'>&nbsp;&nbsp;" & _
        "<input type='button' value='按钮6' onclick='f(this)'>&nbsp;&nbsp;" & _
        "<input type='button' value='按钮7' onclick='f(this)'></div><br><div id='info'></div></body>""").StdOut.ReadAllCOPY

TOP

返回列表