Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question'programme principal 'ce programme est utile aux utilisateurs de portables il permet d'utiliser le serveur 'SMTP autorisé pour leur réseau local où ils se trouvent, leur acces personnelaussi 'dans mons cas il active le proxy dans le cas ou je suis au lycée 'n executez ce script que si vous comprenez tout !!!! 'sauvegardez votre base de registre avant. 'thomas Corrège 2002 L_Welcome_MsgBox_Message_Text = "Modification des serveurs smtp" L_Welcome_MsgBox_Title_Text = "Modification des serveurs smtp TCO" Call change_smtp() ' permet de quitter si pas OK 'création des objets liés aux registres Dim WSHShell Set WSHShell = WScript.CreateObject("WScript.Shell") 'initialisation des variables correspondant à mes serveurs ! ! wanadoo="smtp.wanadoo.fr" iufm = "melurss.toulouse.iufm.fr" aca="envoi1.ac-toulouse.fr" club="mail.club-internet.fr" 'dans la base de registre les comptes sont de messagerie sont numérotés, si un compte est supprimé, son n° est "perdu" dim t(10) t(1)="00000002" t(2)="00000003" t(3)="00000004" t(4)="00000007" t(5)="00000008" t(6)="00000009" t(7)="00000002" 'Ca marche jusqu'à 9 comptes, je travaille à l'automatisation nb = inputbox( " Combien avez-vous de comptes ? (6) ") 'Saisie du serveur à utiliser. rep = inputbox( " 1 pour wanadoo" & chr(13) & _ " 2 pour iufm" & chr(13) & _ " 3 pour ac-toulouse"& chr(13) & _ " 4 pour club internet") if rep = 1 then smtp = wanadoo elseif rep = 2 then smtp = iufm elseif rep = 3 then smtp=aca elseif rep = 4 then smtp=club end if 'modif des serveurs SMTP for i = 1 to nb 'on error goto suite WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts" & t(i) & "\SMTP Server", smtp msgbox ( WSHShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts" & t(i) & "\Account Name") _ & " OK") next 'suite: 'cocher ou décocher l'utilisation du proxy dans les paramètres internet pour ceux qui utilisent IE if rep = 3 then WSHShell.RegWrite "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1,"REG_DWORD" else WSHShell.RegWrite "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0,"REG_DWORD" end if WSHShell.Run "Msimn.exe" 'lancement d'outlook expresse c est le but ultime ' ******************************************************************************** ' * ' * Sub change_smtp() Dim intDoIt intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _ vbOKCancel + vbInformation, _ L_Welcome_MsgBox_Title_Text ) If intDoIt = vbCancel Then WScript.Quit End If End Sub 'doc M$ : www.microsoft.com/france/support/ ascent/data/SKT_WSH.doc