the*_*ous 0 windows batch-file windows-8.1
有没有办法使用bat文件创建这样的提示?
...用户可以单击哪个或多个按钮,这些按钮将根据选择执行代码?
如果bat文件不存在,如何使用其他方法进行处理?
像这个?
这是创建先前输出的批处理文件;用.bat扩展名复制它:
<!-- :: Batch section
@echo off
setlocal
cls
echo Install Windows 8.1?
for /F "delims=" %%a in ('mshta.exe "%~F0"') do set "HTAreply=%%a"
echo Reply: "%HTAreply%"
goto :EOF
-->
<HTML>
<HEAD>
<HTA:APPLICATION BORDER="none" SCROLL="no" >
<SCRIPT language="JavaScript">
window.resizeTo(1100,200);
function closeHTA(reply){
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.GetStandardStream(1).WriteLine(reply);
window.close();
}
</SCRIPT>
<style type="text/css">
body {
margin-left: 10%;
margin-right: 10%;
color: white;
background: #000099;
font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
}
</style>
</HEAD>
<BODY>
<h1>Get Windows 8.1 for free</h1>
<p>Go to the Store to see what's new and get the update. You can keep using your PC while it downloads.<br><br>
<div align="right">
<button onclick="closeHTA('Yes');">Go to the Store</button>
<button onclick="closeHTA('No');">No thanks</button>
</div>
</BODY>
</HTML>
Run Code Online (Sandbox Code Playgroud)
有关在该程序和附加的实施例中使用的方法的更多描述,参见此信息。