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?
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>
<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.