Windows 8.1 提示用户操作 [英] Windows 8.1 prompt for user action

查看:19
本文介绍了Windows 8.1 提示用户操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用bat文件来创建这样的提示?

...哪个有一个或多个用户可以点击的按钮,哪个会根据选择执行代码?

如果bat文件出来了,用其他方法怎么做?

解决方案

喜欢这个吗?

这是创建先前输出的批处理文件;用 .bat 扩展名复制它:

<!-- :: 批处理部分@回声关闭设置本地类echo 安装 Windows 8.1?对于/F "delims=" %%a in ('mshta.exe "%~F0"') 设置 "HTReply=%%a"回声回复:%HTReply%"转到:EOF--><HTML><头部><HTA:APPLICATION BORDER="none" SCROLL="no" ><SCRIPT language="JavaScript">window.resizeTo(1100,200);函数 closeHTA(回复){var fso = new ActiveXObject("Scripting.FileSystemObject");fso.GetStandardStream(1).WriteLine(reply);window.close();}</脚本><style type="text/css">身体 {左边距:10%;右边距:10%;白颜色;背景:#000099;font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;}</风格><身体><h1>免费获得 Windows 8.1</h1><p>前往商店查看新功能并获取更新.您可以在下载时继续使用您的 PC.<br><br><div align="right"><button onclick="closeHTA('Yes');">前往商店</button>&nbsp;<button onclick="closeHTA('No');">不用了,谢谢</button>

</身体></HTML>

有关此程序中使用的方法和其他示例的进一步说明,请参阅这篇文章.

Is there a way to use a bat file to create a prompt like that?

...Which has one or more buttons that the user can click on, which would execute code depending on the choice?

If bat file is out, how to do it using other methods?

解决方案

Like this one?

This is the Batch file that created previous output; copy it with .bat extension:

<!-- :: 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>&nbsp;
   <button onclick="closeHTA('No');">No thanks</button>
   </div>
</BODY>
</HTML>

For a further description on the method used in this program and additional examples, see this post.

这篇关于Windows 8.1 提示用户操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆