[VBA ] 透过admin写hosts的指令?

楼主: cyilung (不全然但是必然)   2017-12-19 09:57:40
因为需要在user权限,
将封锁youtube写入hosts.
但语法有误,一直无法成功,
是否请先进们提供意见?
谢谢。
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "runas /user:admin ""c:\@echo 0.0.0.0 www.youtube.com
>>C:\Windows\System32\Drivers\etc\hosts"""
WScript.Sleep 1000
WshShell.Sendkeys "000000~"

Links booklink

Contact Us: admin [ a t ] ucptt.com