Need help to overwrite file in vbscript

Hello Experts -

I am trying to install additional fonts for windows 7 users via a vbscript.  The problem is that I want to overwrite the existing font if it exists.  With the code below, it will prompt to overwrite if the file is existing.  Is there a way to just overwrite without prompting ?   thanks...

Here is the code :

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")
 
Wscript.Echo "--------------------------------------"
Wscript.Echo " Install Fonts "
Wscript.Echo "--------------------------------------"
Wscript.Echo " "
 
strFontSourcePath = "\\servername\sharefolder\stdfonts\"
 
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")
            Wscript.Echo "Installed Font: " & objFile.Name
            Set objFont = Nothing
        End If
    Next
    Else
        Wscript.Echo "Font Source Path does not exists"
    End If
polshekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zalazarCommented:
You might try to run the script with Administrative permissions (Run as Administrator).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike TLeading EngineerCommented:
Hi,

The website with the same script including the grammatical error ("does not exists") is here:
http://www.cloudtec.ch/blog/tech/install-font-command-line-script-windows-7.html

has a comment from the author to run as admin.

Mike
0
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.