0

我正在编写一个具有 gui 的 vb 脚本,还写入注册表,并安装我拥有的证书。

编写代码后,我使用 iexpress 创建一个 exe 文件,该文件将运行所有文件(cer 和 reg 文件)并安装我的脚本。

问题是我没有看到 reg 和 certicate 安装。

test=MsgBox("To configure wsus on you pc",4,"Wsus installation")
If test = yes Then

Set WshShell = Wscript.CreateObject("Wscript.Shell") 
shell 'regedit -add "\\WSUS.reg"'
shell 'certmgr -add -c "\\wsus.cer" -s -r localMachine root'
shell 'certmgr -add -c "\\wsus.cer" -s -r localMachine trustedpublisher'

RestartServices "localhost", "wuauserv"
If Err.Number <> 0 Then
MsgBox (Err.number & "-" & err.Description)
else
MsgBox "Certificate Install completed"
End If

Else

End If
4

1 回答 1

0

里面的变量test不会等于yes,而是6或者7,6代表yes按钮,7代表no按钮。

因此,当您执行该if语句时,因为test与 yes 不匹配,因为它是 6 它不会安装并简单地转到Else在它之前没有代码的语句end if

于 2014-05-07T13:24:40.490 回答