PDA

Click to See Complete Forum and Search --> : Start Service with VB


efrat
Apr 23rd, 2000, 12:03 PM
Hi All
I want to write some util that start Service
How can i do it ?

Thanks

Efrat

lychew
Apr 25th, 2000, 10:14 AM
See if you can convert this script into a vb program...

Option Explicit
On Error Resume Next


Run "net stop ""IIS admin service"" /y"
Run "net stop ""FTP Publishing Service"""
Run "net stop ""Microsoft SMTP Service"""
Run "net stop ""World Wide Web Publishing Service"""

Run "net start ""World Wide Web Publishing Service"""
Run "net start ""FTP Publishing Service"""
Run "net start ""Microsoft SMTP Service"""



Sub Run(Command)
On Error Resume Next
Dim ShellObject, Result
Set ShellObject = CreateObject("WScript.Shell")
Result = ShellObject.Run(Command, 5, True)
NetResults = NetResults & Result & " "
'Wscript.Echo Result & vbTab & Command
ShellObject = Empty
On Error GoTo 0
End Sub