Sure, heres the code. I had to copy the iisreset.exe object onto my PC. You'll notice it executes locally.
When I run it, nothing happens - no error. And Event Viewer log on server indicates nothing happened.
But Event log on my PC shows:
"DCOM got error General Access Denied from computer memphisweb..."
Thanks. John
Private Sub cmdReset_Click()
Dim RetVal
If LstServers.Text = "memphisweb" Then
'RetVal = Shell("\\memphisweb\winnt$\system32\iisreset /memphisweb") error 5
'RetVal = Shell("\\memphisweb\winnt$\system32\iisreset memphisweb /restart") err 5
'RetVal = Shell("\\memphisweb\winnt$\system32\iisreset.exe memphisweb /restart")
'RetVal = Shell("\\memphisweb\winnt$\system32\iisreset.exe memphisweb /restart"), vbNormalFocus compile/syntax error
'RetVal = Shell("\\memphisweb\winnt$\system32\iisreset.exe memphisweb /restart, 1") error 5 Invalid procedure call or argument
'RetVal = Shell("\\memphisweb\winnt\system32\iisreset /memphisweb") ran, no error but did not reset iis
'RetVal = Shell("\\memphisweb\winnt\system32\iisreset memphisweb /restart") ran, no error but did not reset iis
'RetVal = Shell("\\memphisweb\winnt\system32\iisreset.exe memphisweb /restart") ran, no error DID IT RESET ? no
'RetVal = Shell("\\memphisweb\winnt\system32\iisreset.exe memphisweb /restart"), vbNormalFocus compile/syntax error
'RetVal = Shell("\\memphisweb\winnt\system32\iisreset.exe memphisweb /restart, 1") ran, but did not reset iis
'RetVal = Shell("\\memphisweb\winnt\system32\iisreset.exe") did not reset
'Shell "c:\iisreset.exe memphisweb /restart" this creates a log entry in my Event Viewer General access denied error from memphisweb when attempting to activate the server - at least it tried to run
'RetVal = Shell("\\memphisweb\C:\winnt\system32\iisreset.exe memphisweb /restart, 1") error 5 Invalid procedure call or argument
'** Think this one has correct syntax - but it doesnt reset iis on the server **
Shell "c:\iisreset.exe memphisweb /restart"
End If
'Shell "iisreset memphisweb /restart", vbNormalFocus gives error 53 File not found
'RetVal = Shell("iisreset memphisweb /restart") also get error 53 file not found
'RetVal = Shell("\\memphisweb\winnt$\iisreset memphisweb /restart") gives error 5 invalid procedure call or argument
End Sub