bonjour a tous
j'ai un soucis avec 2sub en vbs
en effet quand je les met dans un vbs elle fonctionnent
mais quand je les met dans une sub a l'intérieur des balise script d'un hta elle me renvoient des valeur"Null" je ne comprend pas pourquoi
quelqu'un a une idée
voila le code pour écrire les 2 valeurs dans le registre
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
 
oReg.CreateKey HKEY_LOCAL_MACHINE,"SOFTWARE\appdis"
 
oReg.SetStringValue HKEY_LOCAL_MACHINE,"SOFTWARE\appdis","identifiant","toto"
oReg.SetStringValue HKEY_LOCAL_MACHINE,"SOFTWARE\appdis","MDP","trucmachin"
et voila le code pour lire les 2 valeurs
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
 
cle= "SOFTWARE\appdis"
oReg.GetStringValue HKEY_LOCAL_MACHINE,cle,"identifiant",strValue
identifiant=strValue
oReg.GetStringValue HKEY_LOCAL_MACHINE,cle,"MDP",strValue
password=strValue
msgbox  identifiant &vbcrlf &  password
toutes les deux fonctionnent très bien dans un ".vbs" c'est assez déroutant
help me !!!