/build/static/layout/Breadcrumb_cap_w.png

Problem with syntax in batch file

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?

 


0 Comments   [ + ] Show comments

Answers (3)

Answer Summary:
Posted by: SMal.tmcc 10 years ago
Red Belt
2

remove the echo in front of the "if"


Comments:
  • 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 - SMal.tmcc 10 years ago
Posted by: naresh9502030090 9 years ago
White Belt
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"

Comments:
  • Please start another thread rather than hijacking this one - EdT 9 years ago
Posted by: rileyz 10 years ago
Red Belt
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. 

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ