Results 1 to 11 of 11

Thread: NT Services

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    13

    NT Services

    I have two NT servers, v4.0, that I need to run verified backups on; I scheduled the backups using the AT command and ntbackup, no problem. However, on one server I need to stop the SQLServerAgent and MSSQLServer services, and on the other I need to stop two services named DiskXtender Agent and DiskXtender Server. The backup will run and (the idea is that) it will verify OK, then the services will be restarted. I was planning on making one VB executable for each server, using the AT command to schedule it, and passing a command-line switch to tell the VB executable to start or stop its appropriate services. Is it possible to write VB code to start and stop individual NT services?

  2. #2
    Junior Member
    Join Date
    Mar 2001
    Posts
    18

    Starting, Pausing, and Stopping NT Services


  3. #3

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    13
    Thanks, looks like it will work! But it doesn't want to let me make a reference to ActiveDS.TLB... any clue on that one?

  4. #4
    Junior Member
    Join Date
    Mar 2001
    Posts
    18

    This is what i did.

    I added a command button and a combo box.
    Named them correctly.

    changed in .bas to allow object to see the form:
    cboService.AddItem oSvc.Name to Form1.cboService.AddItem oSvc.Name

    Added the Reference
    project -> references -> Active DS Type Library

    And the code flew.
    I am running win 2k, vb 6.0.8169

    Not sure if something else needs to be installed for the Active DS Type Library to be used as a reference.

    Hum... shut the service down...Now how to start it back up with code?

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    13
    I read, but I don't comprehend (duh).... the reason I couldn't add the reference was: Project/Components (where I went) is *NOT* the same as Project/References...

    Thanks again!

  6. #6
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179
    what software are you using??
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    13
    VB Learning 6.0. The compiling machine is Win 2000 Pro workstation and the two servers in question are Win NT 4.0; one of the servers is running MS SQL 7.0.

  8. #8
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179
    soz, i mean ... what backup software are you using??
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  9. #9

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    13
    Oops, sorry! Just using plain-vanilla NT backup -- I don't have the budget for Backup Exec, etc...

  10. #10
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179
    before the backup run a batchfile with

    net stop <service>

    after the backup run

    net start <service>

    its what we do by using backup exec, see if nt will let you do a prejob and a postjob command.
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  11. #11

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    13
    Works fine from a batch file -- this will be a good simple setup for this application, and the source code will also come in handy in the future I'm sure... thanks all!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width