0

I'm writing a vb script , that has gui , and also write to the registry , and install certificate that i have.

after writing the code i'm using iexpress , to create an exe file that will run all the files (cer and reg files) and install my script .

the problem is that i don't see the reg and certicate installing .

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
user3433101
  • 23
  • 1
  • 4
  • 8

1 Answers1

0

The variable in test will not equal yes, but 6 or 7, 6 represent yes button, 7 represents no button.

So when you do the if statement, because test doesn't match yes as it is 6 it will not install and simply go to the Else statement which has no code in it before the end if

  • i wrote only this : 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" – user3433101 May 07 '14 at 13:38
  • you use WshShell, but only call using shell, also what is RestartServices. is it a code snippet not included? – AWS Cloud Architect Rob May 07 '14 at 13:48
  • it's restart specific services that i need . – user3433101 May 07 '14 at 13:51