I've written the script below but when I run it (using PrimalScript for troubleshooting) I get the error 'Permission denied'. I'm admin on this device and I get the same error when I run the script elevated.
Here is the script:
Dim WshShell, strCurDir, File, strDesktop
Set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
Set ofso = CreateObject("Scripting.FileSystemObject")
strPath = ofso.GetParentFolderName(WScript.ScriptFullName)
File = "pwsafe.psafe3"
strCurDir = ofso.BuildPath(strPath, File)
ofso.CopyFile strCurDir , strDesktop , OverwriteExisting
What am I doing wrong?
while my last comment showed the script that doesn't work, the script below is combination of Sergio's and Lankymart's work. Wanted to mention them both since they deserve the credit. Here is the working script and I hope someone else makes use of it.
Thank you both.