/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Problem with syntax in batch file

02/03/2014 2011 views

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:
0 Comments   [ + ] Show comments

Comments



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

All 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
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

 
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