VisualBasic VB-Script läuft nicht unter unter 32 Bit Win 7

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 :)

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
 
Ist Windows evtl. nicht unter C:\ installiert?

Sicherer: Statt
Code:
C:\Windows\
Code:
%WINDIR%\
verwenden. Dann klappt das auch mit anderen Laufwerksbuchstaben.
 
Habe ich schon ausprobiert, bringt leider keine Veränderung :(

Oder kennt jemand sonst eine gute Lösung um Schriftarten unter Win7 automatisiert zu verteilen?

Mfg
 
Zuletzt bearbeitet:
Blind bin ich! Da steht ja nicht Target, sondern Source!

Hast du von dem System, auf dem das nicht funktioniert, überhaupt Zugriffsrechte auf diesen Netzwerkpfad, von dem aus die Dateien kopiert werden sollen?
 
Jaja, das ist nicht das Problem. Das Problem ist das auf allen 32 Bit Rechnern das Script nicht abgebrochen wird, wenn die Schriftart schon installiert ist.

If objFSO.FileExists("C:\Windows\Fonts\" & objFile.Name) Then
WScript.Quit

Dieser Schritt funktioniert dann nicht.

Mfg
 
Zurück
Oben