-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSHORTCUT.js
61 lines (48 loc) · 2.2 KB
/
SHORTCUT.js
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
// Created by Shai Efrati, based on:
// ------------------------------------------------------------------------
// Copyright (C) 1996-1997 Microsoft Corporation
//
// You have a royalty-free right to use, modify, reproduce and distribute
// the Sample Application Files (and/or any modified version) in any way
// you find useful, provided that you agree that Microsoft has no warranty,
// obligations or liability for any Sample Application Files.
// ------------------------------------------------------------------------
// This script uses the WSHShell object to create a shortcut to beaverAutoCAD
// on the desktop.
var vbOKCancel = 1;
var vbInformation = 64;
var vbCancel = 2;
var L_Welcome_MsgBox_Message_Text = "This script will create a shortcut to beaverAutoCAD on your desktop.";
var L_Welcome_MsgBox_Title_Text = "beaverAutoCAD installation";
Welcome();
// ********************************************************************************
// *
// * Shortcut related methods.
// *
var WSHShell = WScript.CreateObject("WScript.Shell");
// Read desktop path using WshSpecialFolders object
var DesktopPath = WSHShell.SpecialFolders("Desktop");
// Create a shortcut object on the desktop
var MyShortcut = WSHShell.CreateShortcut(DesktopPath + "\\beaverAutoCAD.lnk");
// Set shortcut object properties and save it
MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings("%userprofile%\\beaverAutoCAD\\beaverAutoCAD.bat");
MyShortcut.WorkingDirectory = WSHShell.ExpandEnvironmentStrings("%userprofile%\\beaverAutoCAD");
MyShortcut.WindowStyle = 4;
MyShortcut.IconLocation = WSHShell.ExpandEnvironmentStrings("%userprofile%\\beaverAutoCAD\\SE.ico, 0");
MyShortcut.Save();
WScript.Echo("A shortcut to beaverAutoCAD now exists on your Desktop.");
//////////////////////////////////////////////////////////////////////////////////
//
// Welcome
//
function Welcome() {
var WSHShell = WScript.CreateObject("WScript.Shell");
var intDoIt;
intDoIt = WSHShell.Popup(L_Welcome_MsgBox_Message_Text,
0,
L_Welcome_MsgBox_Title_Text,
vbOKCancel + vbInformation );
if (intDoIt == vbCancel) {
WScript.Quit();
}
}