Ik heb een script welke ik start wanneer een gebruiker aanmeld. Hierdoor worden fonts uit een share op het werkstation geinstalleerd.
Echter telkens wanneer het werkstation wordt opgestart, wilt het
script de fonts weer opnieuw installeren.
Bestaat er een script waarmee ik kan checken of het font al bestaat, en dat hij dan gewoon het script sluit.
Ik heb dit wel voor files, echter werkt dit niet in Windows 7. Hij sluit dan gewoon het script.
VBScript:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| Dim objShell, objFSO, wshShell Dim strFontSourcePath, objFolder, objFont, objNameSpace, objFile Set objShell = CreateObject("Shell.Application") Set wshShell = CreateObject("WScript.Shell") Set objFSO = createobject("Scripting.Filesystemobject") strFontSourcePath = "\\server\fonts" If objFSO.FolderExists(strFontSourcePath) Then Set objNameSpace = objShell.Namespace(strFontSourcePath) Set objFolder = objFSO.getFolder(strFontSourcePath) For Each objFile In objFolder.files If LCase(right(objFile,4)) = ".ttf" OR LCase(right(objFile,4)) = ".otf" Then Set objFont = objNameSpace.ParseName(objFile.Name) objFont.InvokeVerb("Install") Set objFont = Nothing End If Next Else Wscript.Echo "Font Source Path does not exists" End If |
Echter telkens wanneer het werkstation wordt opgestart, wilt het
script de fonts weer opnieuw installeren.
Bestaat er een script waarmee ik kan checken of het font al bestaat, en dat hij dan gewoon het script sluit.
Ik heb dit wel voor files, echter werkt dit niet in Windows 7. Hij sluit dan gewoon het script.