fuchsify
Lt. Junior Grade
- Registriert
- März 2013
- Beiträge
- 452
Moin!
Ich habe folgendes Problem: Ich habe das unten stende Script um auf Win7 Rechnern Schriftarten von einem Netzlaufwerk heraus nachzuinstallieren. Allerdings soll er, wenn es schon installiert wurde das Script stoppen. Dies funktioniert auch unter Win7 64 bit, komischerweise nicht unter Win7 32 bit. Dort kommt jedesmal die Meldung "Schriftart XYZ ist schon installiert, soll sie erneut installiert werden?". Ich hoffe ihr könnt mir helfen![Lächeln :) :)](/forum/styles/smilies/smile.gif)
Mfg
Das Script:
Option Explicit
' Installing multiple Fonts in Windows 7
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 = "\\kshdc02\netlogon\ScripLogic\Schriftarten\barcode"
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
If objFSO.FileExists("C:\Windows\Fonts\" & objFile.Name) Then
WScript.Quit
Else
Set objFont = objNameSpace.ParseName(objFile.Name)
objFont.InvokeVerb("Install")
Wscript.Echo "Installed Font: " & objFile.Name
Set objFont = Nothing
End If
End If
Next
Else
Wscript.Echo "Font Source Path does not exists"
End If
Ich habe folgendes Problem: Ich habe das unten stende Script um auf Win7 Rechnern Schriftarten von einem Netzlaufwerk heraus nachzuinstallieren. Allerdings soll er, wenn es schon installiert wurde das Script stoppen. Dies funktioniert auch unter Win7 64 bit, komischerweise nicht unter Win7 32 bit. Dort kommt jedesmal die Meldung "Schriftart XYZ ist schon installiert, soll sie erneut installiert werden?". Ich hoffe ihr könnt mir helfen
![Lächeln :) :)](/forum/styles/smilies/smile.gif)
Mfg
Das Script:
Option Explicit
' Installing multiple Fonts in Windows 7
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 = "\\kshdc02\netlogon\ScripLogic\Schriftarten\barcode"
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
If objFSO.FileExists("C:\Windows\Fonts\" & objFile.Name) Then
WScript.Quit
Else
Set objFont = objNameSpace.ParseName(objFile.Name)
objFont.InvokeVerb("Install")
Wscript.Echo "Installed Font: " & objFile.Name
Set objFont = Nothing
End If
End If
Next
Else
Wscript.Echo "Font Source Path does not exists"
End If