SUPINFO International University

SUPINFO Institute of Information Technology
Laboratoire Microsoft




Installation d'un service

Accueil > Script > maintenance > Installation d'un service

Installation d'un service

Par Nicolas MILBRAND, LABORATOIRE SUPINFO DES TECHNOLOGIES MICROSOFT
Publiée le 07/03/2005 vers 20h.

Description :
Ce script VBS installe backup.bat en temps que service en demarrage manuel avec le compte LocalService.

Script :

:

Const OWN_PROCESS = 16
Const NOT_INTERACTIVE = False
Const NORMAL_ERROR_CONTROL = 2
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objService = objWMIService.Get("Win32_BaseService")
errReturn = objService.Create("Nom_du_service" ,"Sauvegarde du répertoire toto" , _
"d:\script\Bakup.bat", OWN_PROCESS, NORMAL_ERROR_CONTROL, "Manual", _
NOT_INTERACTIVE, "NT AUTHORITY\LocalService", "password" )
Wscript.Echo errReturn



Proposer un script

Notre avis :

Votre avis :

Réactions :
0

Votants :
3

Visites :
10002

1
2
3
4
5

Script Précédent :

Supprimer un lecteur réseau

Script Suivant :

Suppression d'un service



Retrouvez ci-dessous les autres sections du Laboratoire Microsoft