-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopy Shortcut.vbs
More file actions
40 lines (35 loc) · 1.35 KB
/
Copy pathCopy Shortcut.vbs
File metadata and controls
40 lines (35 loc) · 1.35 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
'------------------------------------------------------------------------
'
'
'
' Shawn Stugart
'========================================================================
Option Explicit
const HKEY_LOCAL_MACHINE = &H80000002
const ForReading = 1
Dim sFileName, oFSO, oShell, oInputFile, oNet, oURLLink2
Dim strComputer, strResult, strDesktop, oURLLink1, strSetup
On Error Resume Next
sFileName = "clients.txt"
set oFSO = CreateObject("Scripting.FileSystemObject")
set oInputFile = oFSO.OpenTextFile("c:\" & sFileName, ForReading)
Do Until oInputFile.AtEndOfStream
strComputer = oInputFile.Readline
set oNet = CreateObject("WScript.Network")
oNet.MapNetworkDrive "X:", "\\" & strComputer & "\C$"
strDesktop = "\Documents and Settings\All Users\Desktop"
set oShell = CreateObject("WScript.Shell")
set oURLLink1 = oShell.CreateShortcut("X:" & strDesktop & "\2266 Course Evaluation.url")
oURLLink1.TargetPath = "http://www.metricsthatmatter.com/usnhco/spr"
oURLLink1.Save
set oURLLink2 = oShell.CreateShortcut("X:" & strDesktop & "\Integrated Learning Manager.url")
oURLLink2.TargetPath = "http://my.newhorizons.com"
oURLLink2.Save
oNet.RemoveNetworkDrive "X:", True
If Err.Number = 0 Then
WScript.Echo "Shortcut copied to " & strComputer
Else
WScript.Echo "FAILED. Could not copy shortcut to " & strComputer
Err.Clear
End If
Loop