回 帖 发 新 帖 刷新版面

主题:求高手把我这段VB脚本翻译成其他编程语言

求高手把我这段VB脚本程序翻译成其他编程语言,VB,VC,C#什么的都行。不胜感激。
本人QQ 22731153,希望详谈,敬请赐教!

Dim WSUSREG
Set WSUSREG=WScript.CreateObject("WScript.Shell")
RegPath="HKLM\Software\Policies\Microsoft\windows\windowsupdate\"
name1="WUServer"
name2="WUStatusServer"
name3="TargetGroup"
name4="TargetGroupEnabled"
name5="ElevateNonAdmins"

type1="REG_SZ"
type2="REG_DWORD"
MsgBox("Microsoft Update 服务安装过程开始...")

WSUSREG.Run("Net Stop wuauserv")
WScript.Sleep 100  

WSUSREG.RegWrite RegPath,Default
WSUSREG.RegWrite RegPath&name1,"http://10.252.0.27","REG_SZ" 'WSUS服务器ip地址                   
WSUSREG.RegWrite RegPath&name2,"http://10.252.0.27","REG_SZ" 'WSUS 建立的组名                    
WSUSREG.RegWrite RegPath&name3,"workgroup","REG_SZ"          
WSUSREG.RegWrite RegPath&name4,"1","REG_DWORD"               '1允许客户端自动加入到组,0 不允许  
WSUSREG.RegWrite RegPath&name5,"0","REG_DWORD"

'MsgBox("Success!")

Dim AU
Set AU=WScript.CreateObject("WScript.Shell")
RegPath="HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\"

keyname1="NoAutoUpdate"
keyname2="AUOptions"
keyname3="ScheduledInstallDay"
keyname4="ScheduledInstallTime"
keyname5="NoAutoRebootWithLoggedOnUsers"
keyname6="AutoInstallMinorUpdates"
keyname7="RebootRelaunchTimeoutEnabled"
keyname8="RebootRelaunchTimeout"
keyname9="RescheduleWaitTimeEnabled"
keyname10="RescheduleWaitTime"
keyname11="DetectionFrequencyEnabled"
keyname12="RebootWarningTimeoutEnabled"
keyname13="RebootWarningTimeout"
keyname14="UseWUServer"
keyname15="NoAUShutdownOption"
keyname16="NoAUAsDefaultShutdownOption"

keytype="REG_DWORD"


AU.RegWrite RegPath,Default
AU.RegWrite RegPath&keyname1,"0",keytype
AU.RegWrite RegPath&keyname2,"4",keytype
AU.RegWrite RegPath&keyname3,"0",keytype
AU.RegWrite RegPath&keyname4,"18",keytype
AU.RegWrite RegPath&keyname5,"1",keytype
AU.RegWrite RegPath&keyname6,"1",keytype
AU.RegWrite RegPath&keyname7,"1",keytype
AU.RegWrite RegPath&keyname8,"60",keytype
AU.RegWrite RegPath&keyname9,"1",keytype
AU.RegWrite RegPath&keyname10,"16",keytype
AU.RegWrite RegPath&keyname11,"1",keytype
AU.RegWrite RegPath&keyname12,"1",keytype
AU.RegWrite RegPath&keyname13,"30",keytype
AU.RegWrite RegPath&keyname14,"1",keytype
AU.RegWrite RegPath&keyname15,"0",keytype
AU.RegWrite RegPath&keyname16,"0",keytype
WSUSREG.Run("Net Start wuauserv") 
WScript.Sleep 100 
WSUSREG.Run("wuauclt /detectnow")

MsgBox("Microsoft Update 服务已安装成功!")

回复列表 (共5个回复)

沙发

有报酬的哦……

板凳

既然你说有报酬的,那我就不说了,免得挡别人的财路。。。
几句代码的改动的事儿。。

3 楼


哥,求详谈!
不胜感激

4 楼


哥,求详谈!
小弟不胜感激

5 楼


小弟也是出于无奈啊,才行此下策。
这世道,不说也都知道。

我来回复

您尚未登录,请登录后再回复。点此登录或注册