我想製作一個能夠將文件複製到c:\windows\system32\whatever.vbs
的程序。問題是我的運行時遇到「拒絕訪問」。VBS訪問被拒絕
我試圖獲得管理員權限,但仍然出現UAC。任何人都可以給我一個腳本,以管理員身份運行我的vbs,並在運行時禁用UAC?
下面是代碼:
option explicit
dim folder, root, f1, source, destination, regedit, WshNetwork
function CopyFile(source, destination)
dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists(source) Then
filesys.CopyFile source, destination
End If
end function
Set WshNetwork = WScript.CreateObject("WScript.Network")
set folder = CreateObject("Scripting.FileSystemObject")
set root = folder.GetFile(Wscript.ScriptFullName)
source = root
destination = "c:\Documents And Settings\" & WshNetwork.UserName &"\Start Menu\Programs\Startup\whatever.vbs"
call CopyFile(source,destination)
destination = "c:\Windows\System32\whatever.vbs" -> in here access is denied
call CopyFile(Source,destination)
我們無法通過代碼 – Anuraj 2012-07-18 05:40:51