Dutchict
asked on
Need help Vb script copy fonts
Can you help me to create the following script
The users get a error when the font exist.
How can i make a if else, that verifying that the files exist?
If the fonts exist then nothing.
else copy the fonts
Maybe it's better to create a array for the fonts.
The users get a error when the font exist.
How can i make a if else, that verifying that the files exist?
If the fonts exist then nothing.
else copy the fonts
Maybe it's better to create a array for the fonts.
Const FONTS = &H14&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(FONTS)
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\FRABK.TTF"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\FRABKIT.TTF"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\FRADM.TTF"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\FRADMCN.TTF"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\FRADMIT.TTF"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\FRAHVIT.TTF"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\framd.ttf"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\framd__0.ttf"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\FRAMDCN.TTF"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\FRAMDIT0.TTF"
objFolder.CopyHere "\\2k3svr02\netlogon\deploy_fonts\fonts\framdit.ttf"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm an beginner in scripting understand the solution.
The simple solution would be adding the line:
on error resume next
in the beginning of the script, this will ignore all the errors. After the file copy you can turn error reporting on if you need to run more operations by adding the line:
on error goto 0
Simple solution would be:
Open in new window