Why is my script not working.
Ok so here's what I need to do,
I need to copy a shortcut from all users, start menu, programs, general applications folder to current user, start menu, programs, general applications folder, when I run my script I get a permission denied error, code 800A0046. What's wrong with my script folks? Below is the script in question
Script
Dim strAllUsersPgm
Dim strTeammateCitrixSSO
Dim strFile
set wshShell = createobject("Wscript.Shell")
Set wshFileSys = CreateObject("Scripting.FileSystemObject")
strAllUsersPgm = wshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%") & "\Start Menu\Programs\General Applications"
strTeamMateCitrixSSO = wshShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Start Menu\Programs\General Applications"
strFile = strAllUsersPgm & "\Teammate Citrix SSO.lnk"
If wshFileSys.FileExists(strFile) Then
wshFileSys.CopyFile strFile, strTeamMate, True
End If
I need to copy a shortcut from all users, start menu, programs, general applications folder to current user, start menu, programs, general applications folder, when I run my script I get a permission denied error, code 800A0046. What's wrong with my script folks? Below is the script in question
Script
Dim strAllUsersPgm
Dim strTeammateCitrixSSO
Dim strFile
set wshShell = createobject("Wscript.Shell")
Set wshFileSys = CreateObject("Scripting.FileSystemObject")
strAllUsersPgm = wshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%") & "\Start Menu\Programs\General Applications"
strTeamMateCitrixSSO = wshShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Start Menu\Programs\General Applications"
strFile = strAllUsersPgm & "\Teammate Citrix SSO.lnk"
If wshFileSys.FileExists(strFile) Then
wshFileSys.CopyFile strFile, strTeamMate, True
End If
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
murali.bhat
14 years ago
Use this. This line edited from :
wshFileSys.CopyFile strFile, strTeamMate, True
To:
wshFileSys.CopyFile strFile, strTeamMate & "\"
------------------------------------------------------------
Dim strAllUsersPgm
Dim strTeammateCitrixSSO
Dim strFile
set wshShell = createobject("Wscript.Shell")
Set wshFileSys = CreateObject("Scripting.FileSystemObject")
strAllUsersPgm = wshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%") & "\Start Menu\Programs\General Applications"
strTeamMateCitrixSSO = wshShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Start Menu\Programs\General Applications"
strFile = strAllUsersPgm & "\Teammate Citrix SSO.lnk"
If wshFileSys.FileExists(strFile) Then
IF NOT wshFileSys.FolderExists(strTeamMateCitrixSSO) Then
wshFileSys.CreateFolder(strTeamMateCitrixSSO)
End if
wshFileSys.CopyFile strFile, strTeamMateCitrixSSO & "\"
End If
wshFileSys.CopyFile strFile, strTeamMate, True
To:
wshFileSys.CopyFile strFile, strTeamMate & "\"
------------------------------------------------------------
Dim strAllUsersPgm
Dim strTeammateCitrixSSO
Dim strFile
set wshShell = createobject("Wscript.Shell")
Set wshFileSys = CreateObject("Scripting.FileSystemObject")
strAllUsersPgm = wshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%") & "\Start Menu\Programs\General Applications"
strTeamMateCitrixSSO = wshShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Start Menu\Programs\General Applications"
strFile = strAllUsersPgm & "\Teammate Citrix SSO.lnk"
If wshFileSys.FileExists(strFile) Then
IF NOT wshFileSys.FolderExists(strTeamMateCitrixSSO) Then
wshFileSys.CreateFolder(strTeamMateCitrixSSO)
End if
wshFileSys.CopyFile strFile, strTeamMateCitrixSSO & "\"
End If
Posted by:
anonymous_9363
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.