Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBscript service control compile error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to write code so the end result would be turning off a service that has failed.

I keep getting a compile error when I try compiling in VB. It highlights Set and states invalid outside procedure.


Can anyone help?

Thanks
 
bk1031,

Set objService = GetObject("WinNT://" & Server & "/" & ServiceName)
objService.Stop



fengshui_1998
 
The Set statement is an executable line of code and must fall within a procedure (Sub,Function,etc..). Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top