I'm having a bit of a struggle trying to get a script to work which copies a shortcut lnk file from a server share to a users desktop. I've found the attached code below on here and changed it to my needs, but I get a problem in that I get a message saying that in line 6 there is an error as the file specified cannot be found. I know it's there and have checked everything.
The only thing I can think of is that I'm trying this over a VPN connection. Would that make a diffference?
Any help would be appreciated.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objProcess = objShell.Environment("Process")
strDesktop = objProcess.Item("UserProfile") & "\Desktop\"
boolOverwrite = False
objFSO.CopyFile "\\myServer\myShare$\InfoChecking\Auditing.lnk", strDesktop, boolOverwrite