Dim Profiles,Thunderbird,fileprefs,profile_ini
Dim ProfDirs, OldProfileFolder
Dim strSource, strSource3
Dim fso
Dim numprof
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Profiles = "Profiles\"
Thunderbird="Thunderbird\"
fileprefs = "prefs.js"
profiles_ini = "profiles.ini"
Set un = WScript.CreateObject ( "WScript.Shell" )
UserName = un.ExpandEnvironmentStrings ( "%USERNAME%" )
PathApps = un.ExpandEnvironmentStrings ( "%APPDATA%" ) & "\"
PathLocal = un.ExpandEnvironmentStrings ( "%USERPROFILE%" ) & "\Local Settings\Thunderbird\"
Public Function Find_profile
numprof = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(PathApps & Thunderbird & profiles_ini, ForReading)
i = 0
Do Until objFile.AtEndOfStream
strLine1 = objFile.ReadLine
If InStr(strLine1, "Name=default") Then
i = i + 1
strLine1 = objFile.ReadLine
strLine1 = objFile.ReadLine
ProfDirs = Replace(strLine1,"Path=Profiles/","" )
OldProfileFolder = PathApps & Thunderbird & Profiles & ProfDirs & "\"
End If
Loop
numprof = i
objFile.Close
If numprof = 1 Then
Find_profile = OldProfileFolder
Else
Find_profile = ""
End If
End function
strSource = Find_profile + "extensions\{e2fda1a4-762b-4020-b5ad-a41df1933103}"
strSource2 = strSource + "\update_light102b.txt"
If fso.FileExists(strSource2) Then
else
fso.CopyFolder "\\server\distr$\Update_GPO\Lighting\{e2fda1a4-762b-4020-b5ad-a41df1933103}", strSource, true
end if
Source: https://habr.com/ru/post/106322/