Export de variable d'un script à un autre
Bonjour,
J'ai écrit un script qui supprime les profils locaux de A00001 à A99999 dans "C:\Documents and Settings" (sous WinXP).
Tout fonctionne bien, sauf que je voudrais afficher une popup "Suppression du profil Axxxx en cours. Veuillez patienter ...".
Mais je n'arrive pas à récupérer la variable correspondant au nom du profil en cours de suppression.
La popup m'affiche juste "Suppression du profil en cours. Veuillez patienter ..."
Voici mon script principal :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Dim ProfilRep, RepPath,RepName
Dim OFSO,OSh,oExec
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oSh = CreateObject("WScript.Shell")
ProfilRep = "C:\Documents and Settings"
on error resume next
For i = 1 TO 99999
if i > 0 and i < 10 then RepPath = ProfilRep & "\a0000" & i
if i > 9 and i < 100 then RepPath = ProfilRep & "\a000" & i
if i > 99 and i < 1000 then RepPath = ProfilRep & "\a00" & i
if i > 999 and i < 10000 then RepPath = ProfilRep & "\a0" & i
if i > 9999 and i < 100000 then RepPath = ProfilRep & "\a" & i
IF oFSO.FolderExists(RepPath) = true Then RepName = Right(RepPath,6) : Set oExec = oSh.Exec ("WScript Suppr.vbs") : oFSO.DeleteFolder RepPath, true : oExec.Terminate
Next |
Voici mon script de popup (suppr.vbs) :
Code:
1 2
| Set oSh = CreateObject("WScript.Shell")
oSh.Popup ("Suppression du profil " & RepName & " en cours, veuillez patienter ..."), 100000 |
Je suppose qu'il faudrait définir ma variable RepName différemment.
J'ai essayé plein de trucs, mais je débute en VBS et je n'y arrive pas. :(
Ca doit être tout bête en plus ... Merci d'avance pour votre aide.