In this script I am writing, I need to copy a lnk from a share to the all users desktop. When the script runs I get an error "Permission Denied". I have not been able to figure this one out. any ideas?
The line is as below
FSO.CopyFile "\\south01\mtmm\Microtype_Network.lnk",_ strDesktop
__________________________________________________________
Option Explicit
Dim objNetwork, FSO, WshShell, objFSO, strDesktop
'On error Resume Next
Set FSO =CreateObject("scripting.FileSystemObject")
'Copy MTM.bat to c:\
If FSO.FileExists("C:\MTM.bat") Then
FSO.DeleteFile("C:\MTM.bat")
End If
FSO.CopyFile "\\south01\mtmm\mtm.bat", "c:\", True
'Copy microtype_network.lnk to allusers desktop
Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
FSO.CopyFile "\\south01\mtmm\Microtype_Network.lnk",_ strDesktop
'Map K: drive to south01\keyboarding$
Set objNetwork = WScript.CreateObject("WScript.Network")
If fso.DriveExists("k:") Then
Else
objNetwork.MapNetworkDrive "K:" , "\\south01\keyboarding$"
End If
'If FSO.FolderExists("K:\south01\keyboarding$") Then
'Else
'objNetwork.MapNetworkDrive "K:" , "\\south01\keyboarding$"
'End If
'Execute MTMM.exe
WshShell.Run "k:\mtmm\mtmm.exe", 1, True
' End of Example VBScript.