Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <!--
- This is an HTML Application. It must be saved as a .hta file.
- While it's in HTML format, it's not meant to be opened under a web browser.
- But it does require Internet Explorer 7+, and Windows XP or later.
- Windows already handles HTA files out of the box.
- Simply double-click the file to run it.
- -->
- <meta http-equiv="x-ua-compatible" content="IE=9" />
- <title>Prompt Run</title>
- <style>
- body { margin:3vh 1.69vw; font-size:12pt }
- div { height:10vh }
- #t {
- display:block; margin-bottom:3vh; box-sizing:border-box; width:96.62vw;
- height:74vh
- }
- button { margin:0 10vw; width:5em }
- </style>
- </head>
- <body>
- <div>
- Please enter command line arguments for: <span id=s></span>
- </div>
- <textarea id=t></textarea>
- <center>
- <button id=o>OK</button><button id=c>Cancel</button>
- </center>
- <hta:application id=h innerborder=no scroll=no></hta:application>
- <script>
- z = screen.height / 2;
- resizeTo(z / 3 * 4, z);
- if (!(a = h.commandLine.match(/^(?:".*?"|\S+)\s+(".*?"|\S+)\s*(.*)/))) {
- alert('Usage: PromptRun.hta {program file} [initial arguments...]');
- close()
- }
- s.textContent = a[1];
- t.value = a[2];
- c.onclick = function(){
- close()
- };
- o.onclick = function() {
- (new ActiveXObject('wscript.shell')).run(s.textContent + ' ' + t.value);
- close()
- };
- t.selectionStart = t.value.length;
- t.focus();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement