Hi all,
I was wondering whether you could help. Basically I want to merge the 2 scripts below so that the remove shortcut script comes first before the add shortcut script.
Remove Shortcut Script
Option Explicit
Dim oFS, oWsh, oNetwork, strUser, Shell
Dim DesktopPath, link
Dim folder, file, icon1
Set oWsh = CreateObject("WScript.Shell")
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
Set oNetwork= CreateObject("Wscript.Network")
Set Shell = CreateObject("WScript.Shell")
strUser = oNetwork.UserName
DesktopPath = Shell.SpecialFolders("Desktop")
icon1 = UCase(oWsh.SpecialFolders("Desktop") & "\<name of shortcut>.lnk")
Set folder = oFS.GetFolder(DesktopPath)
For Each file In folder.Files
Select Case UCase(file)
Case icon1
oFS.DeleteFile(file)
End Select
next
WScript.Quit (0)
Add Shortcut Script
Dim FileName, UploadStac
UploadStac ="Stac Upload"
FileName = "<name of shortcut>"
Set shortcut = CreateObject("WScript.Shell").CreateShortcut(CreateObject("WScript.Shell").SpecialFolders("Desktop") & + "\" + FileName + ".lnk")
shortcut.Description = "<shortcut description>"
shortcut.TargetPath = "<file path of shortcut>"
shortcut.Arguments = "/Arguments:Shortcut"
shortcut.Save
Can this be done?
Your help would be much appreciated.
Kind regards,
RocknRollTim