Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Last active September 30, 2023 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderofsalvation/85b155fb5d9b8e658f8587f161d50d15 to your computer and use it in GitHub Desktop.
Save coderofsalvation/85b155fb5d9b8e658f8587f161d50d15 to your computer and use it in GitHub Desktop.
mshta hta example skeleton jscript windows 10
mshta.exe %cd%/skeleton.hta
<HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=11" />
<TITLE>your title</TITLE>
<HTA:APPLICATION ID="app"
APPLICATIONNAME="monster"
ICON="your.ico"
SINGLEINSTANCE="yes"
SYSMENU="yes"
WINDOWSTATE="normal">
</HEAD>
<body>
<script language="javascript" type="text/javascript">
window.resizeTo(360, 360 );
//alert("windowstate = "+app.windowState+" commandline = "+app.commandLine);
//WshShell = new ActiveXObject("WScript.Shell");
//WshShell.Run("c:/windows/system32/notepad.exe", 1, false);
function showOption(el){
for( var i = 0; i < el.options.length; i++ ){
id = el.options[ el.selectedIndex ].value;
$(id).style.display = (( el.options[i].value == id ) ? "block" : "none");
}
}
function pickfolder(){
var shl = new ActiveXObject("Shell.Application");
var folder = shl.BrowseForFolder(0, "Please choose a folder.", 0, 0x00);
WSH.Echo(folder ? folder.self.path : '');
}
//setTimeout( update, 500 ); // DOMREADY :D
</script>
<style type="text/css">
body { font-family: "MS Sans Serif",Arial; font-size:12px; line-height:20px }
.digit { width:30px }
legend { font-weight:bold}
.container{ padding:10px }
.span-1 { float:left; width: 50px }
.span-2 { float:left; width: 100px }
.span-3 { float:left; width: 150px }
.span-4 { float:left; width: 200px }
.hidden { display:none }
input[type=text]{ border:1px solid #BBB; border-radius:2px; font-size:15px; padding:5px 2px;}
button.big { margin-top:10px; width:100%; height:40px; border:1px solid #BBB; border-radius:2px; }
textarea { width:100%; height:150px;}
fieldset{ border:1px solid #DDD; border-radius:5px; }
</style>
<img src="avs-vjgen.jpg">
<center>
subtitle here
</center>
<br>
<form>
<fieldset id="options_vsl">
<legend>Bar</legend>
<div class="container">
<input type="text" placeholder="foo" style="width:100%" name="svl" onchange="writeINI('svl', this.value )"/>
</div>
</fieldset>
<button class="big" onclick="pickfolder()">choose folder</button>
<center>
<br>
Authorname (c) - (year)
<center>
<form>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment