Hi all,

I'm having some trouble finding the error in the syntax for a batch file I wrote. Google was very little help, and I'm new to batch files, and scripting in general, so I apologize if this is wasting anyone's time.

The batch file is as follows:

**BEGIN BATCH**

@echo off
cls
echo.
echo.
echo This will install the Company Fonts.
echo.
echo.
echo if exists C:\Windows\Fonts\companyfonts*.ttf goto END
wscript "\\server\filepath\Fonts.vbs"
echo.
echo Fonts have been installed.

:END

The problem I'm running into has to do with the "IF" statement. The batch file should be checking to see if the company fonts are already on the computer, and if they are, it should terminate immediately.

Instead it's calling the vbscript anyway, and if the fonts are already installed, the users get a "Copy/Replace" prompt for each font the vbscript is calling.

Please, how can I configure this batch file to check for the fonts, and terminate itself without calling the vbscript if it detects them?

 

Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

2

remove the echo in front of the "if"

Answered 02/03/2014 by: SMal.tmcc
Red Belt

  • https://www.google.com/search?q=bacth+file+if+statement&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb
Please log in to comment

Answers

0
hi folks,

Advance thanks please help vbs to "vbscript for to verify if the website is configured for https or not.if not means msg want to show as "not configure for https"
Answered 09/23/2014 by: naresh9502030090
White Belt

  • Please start another thread rather than hijacking this one
Please log in to comment
0

@echo off
cls
echo.
echo.
echo This will install the Company Fonts.
echo.
echo.
if exists C:\Windows\Fonts\companyfonts*.ttf goto END
wscript "\\server\filepath\Fonts.vbs"
echo.
echo Fonts have been installed.

:END

 

*Cough

echo if exists C:\Windows\Fonts\companyfonts*.ttf
if exists C:\Windows\Fonts\companyfonts*.ttf 

(:



Please note this is not the best approach, there are some registry settings that need added with the fonts as well, but I cant see your VBS script so im hoping it covers that bit. 

Answered 02/03/2014 by: rileyz
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity