以下のスクリプトを作成しましたが、(トラブルシューティングにPrimalScriptを使用して)実行すると、「アクセスが拒否されました」というエラーが表示されます。私はこのデバイスの管理者ですが、昇格したスクリプトを実行すると同じエラーが発生します。
スクリプトは次のとおりです。
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
私は何が間違っているのですか?
私の最後のコメントは機能しないスクリプトを示していましたが、以下のスクリプトはSergioとLankymartの作業を組み合わせたものです。彼らは信用に値するので、両方に言及したかった。これが作業スクリプトです。他の誰かがそれを利用してくれることを願っています。
Dim ofso, oshell, oproc, strDesktop, overwrite
Set ofso = CreateObject("Scripting.FileSystemObject")
Set oshell = CreateObject("WScript.Shell")
Set oproc = oshell.Environment("Process")
strDesktop = oproc.Item("ALLUSERSPROFILE") & "\Desktop\"
overwrite = True
ofso.CopyFile "pwsafe.psafe3" , strDesktop , overwrite
あなたがた両方に感謝します。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加