Program is used to set system environment variables. You can change enviroment to user to set user variables.
Dim currentpathcurrentpath = Createobject ("scripting. fileSystemObject "). getfolder (". "). pathmsgbox currentpathdim ocrpathocrpath = currentpath & "\ Tesseract-OCR" settheenv (ocrpath) function settheenv (ocrpath) dim psysenvset psysenv = Createobject ("wscript. shell "). environment ("system") psysenv ("tessdata_prefix") = ocrpath & "\" dim existvalueexistvalue = psysenv ("path") dim target, S, exist, else = falseappend Value = ocrpath & ";" & ocrpath & "\ training" existvalue = existvalue & ";" & appendvalueexistvalue = reduce (existvalue, false, ";") target = Split (existvalue, ";") existvalue = "" for each s in targetif S <> "" thenexistvalue = existvalue & S & ";" End ifnextpsysenv ("path ") = existvalue 'existvalue = psysenv ("wdir") 'msgbox ("wdir =" & existvalue) msgbox "Environment setting successful! "End functionfunction reduce (srcstr, casesentive, SP) dim objdict, X, ysrcarr = Split (TRIM (srcstr), SP) set objdict = Createobject (" scripting. dictionary ") for each X in srcarrif not casesentive then Y = lcase (x) Elsey = xend ifif not objdict. exists (y) then if y <> lcase (driverletter) & "\" thenobjdict. add y, xend ifend ifnextreduce = join (objdict. items, SP) set objdict = nothingend Function