'Cacher un utilisateur dans l'écran d'accueil
'Ce code est libre de droit

Option Explicit

'Declarer variables
Dim WSHShell, n, p, itemtype, MyBox, User, Title, Prompt

'Fixer variables
p = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList\"
itemtype = "REG_DWORD"
n = 0

Prompt = "Entrer le nom de l'utilisateur à cacher." & vbCR & "ATTENTION à bien orthographier le nom" & vbCR & "En cas d'erreur, une clé inutile serait créée"
Title = "Cacher un utilisateur à l'invite de sessions"
User = InputBox(Prompt, Title,"")

If User = "" Then
	Title = "Erreur!"
	Prompt = "Vous avez oublié de saisir le nom!!"
	MyBox = MsgBox(Prompt,4096,Title)
Else
	p = p & User
	Set WSHShell = WScript.CreateObject("WScript.Shell")
	WSHShell.RegWrite p, n, itemtype
	Title = "C'est fait!"
	Prompt = User & " a maintenant disparu de l'écran d'accueil."	
	
	MyBox = MsgBox(Prompt, 4096, Title)
End If

Set WshShell = Nothing
