-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial_03.hta
More file actions
48 lines (40 loc) · 1.08 KB
/
tutorial_03.hta
File metadata and controls
48 lines (40 loc) · 1.08 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
<!DOCTYPE html>
<html>
<head>
<title> </title>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<hta:application id="mainapp"
applicationName="Tutorials"
contextMenu="no"
icon="explorer.exe"
selection="no"
singleInstance="yes"
version="1.0"
/>
<script>
// window setup
window.resizeTo(500,300)
var xpos = (screen.width - window.outerWidth) / 2
var ypos = (screen.height - window.outerHeight) / 2
window.moveTo(xpos, ypos)
// functions
function yesBtn() {
mytext.innerText = 'Welcome, Jeremy'
}
function quitApp() {
window.close()
}
function runCommand(command) {
var wss = new ActiveXObject('WScript.Shell')
wss.run(command)
}
</script>
</head>
<body>
<i id="mytext">Are you Jeremy?</i>
<button onclick="yesBtn()">Yes</button>
<button onclick="quitApp()">No</button>
<button onclick="runCommand('notepad.exe')">Open Notepad</button>
<button onclick="runCommand('c:/users/%username%/desktop')">Open Desktop</button>
</body>
</html>