Board index » Visual Studio » Permission Denied error

Permission Denied error

Visual Studio298
I have a script that I am trying to get to work. It is suppose to

replace some existing shorcuts with new ones. The shortcuts are

located in a folder called "Applications" on all of the users desktops.

The script works if the shorcuts are on the desktop, but not when they

are in the Applications folder. The script doesn't even work on my PC

and I am an administrator.



Any help is greatly appreciated.



Here is what I have, the variables are in a dim statement at the

beginning of the script:



'Replace Office 2000 shorcuts with Office XP shortcuts

Set oShell = CreateObject("WScript.Shell")

Set oFSO = CreateObject("scripting.FileSystemObject")

aDesktopPath = oShell.SpecialFolders("Desktop") & "\Applications"

oFSO.CopyFile "\\pusher\apps\OfficeXPShortcuts\Microsoft Access.lnk",

aDesktopPath, True


-
 

Re:Permission Denied error

<jpsheets@gmail.com>wrote in message

Quote
I have a script that I am trying to get to work. It is suppose to

replace some existing shorcuts with new ones. The shortcuts are

located in a folder called "Applications" on all of the users desktops.

The script works if the shorcuts are on the desktop, but not when they

are in the Applications folder. The script doesn't even work on my PC

and I am an administrator.



Any help is greatly appreciated.



Here is what I have, the variables are in a dim statement at the

beginning of the script:



'Replace Office 2000 shorcuts with Office XP shortcuts

Set oShell = CreateObject("WScript.Shell")

Set oFSO = CreateObject("scripting.FileSystemObject")

aDesktopPath = oShell.SpecialFolders("Desktop") & "\Applications"

oFSO.CopyFile "\\pusher\apps\OfficeXPShortcuts\Microsoft Access.lnk",

aDesktopPath, True



Add a backslash to the end of <"\Applications">:



aDesktopPath = oShell.SpecialFolders("Desktop") & "\Applications\"







-

Re:Permission Denied error

Worked great!



Thanks!



-