-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial_05.hta
More file actions
62 lines (54 loc) · 1.55 KB
/
tutorial_05.hta
File metadata and controls
62 lines (54 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<title>Run This Text</title>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<hta:application id="mainapp"
applicationName="Tutorials"
contextMenu="no"
icon="powershell.exe"
selection="no"
singleInstance="yes"
version="1.0"
/>
<script>
// window setup
window.resizeTo(500,200)
var xpos = (screen.width - window.outerWidth) / 2
var ypos = (screen.height - window.outerHeight) / 2
window.moveTo(xpos, ypos)
// functions
function runCommand(command) {
var wss = new ActiveXObject('WScript.Shell')
wss.run(command)
}
</script>
</head>
<body>
<div id="messOut">
<!-- display message here -->
</div>
<input type="text" onkeypress="if (event.keyCode == 13) runCommand(this.value)" />
<i id="hint" title="To submit, hit the enter key.">?</i>
<script>
var mess = "Input in your command..."
var len = mess.length
var i = 0
var typer = setInterval(function(){
messOut.innerText += mess.charAt(i)
i += 1
if (i >= len) {
clearInterval(typer)
}
}, 100)
setTimeout(function() {
window.resizeBy(400)
hint.innerText = hint.title
setTimeout(function(){
window.resizeBy(-400)
hint.innerText = '?'
}, 2000)
}, 5000)
</script>
</body>
</html>