Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 173917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:25:41+00:00 2026-05-11T13:25:41+00:00

One of the first lines in a batch file I have is this: IF

  • 0

One of the first lines in a batch file I have is this:

IF '%FirstServer2%' == 'No' goto :SkipSolution 

The variable %FirstServer2% is not declared anywhere, so it must be passed to the batch file somehow. So, how can I pass in the value?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:25:42+00:00Added an answer on May 11, 2026 at 1:25 pm
    set FirstServer2=No MyBatchFile.cmd 

    Simply set the environment variable beforehand and start your batch afterwards.

    Named parameters are a bit misleading in this case, as FirstServer2 is just a normal environment variable.

    I have used a similar technique in a batch I wrote once which was pretty configurable. Depending on whether variables were set or not it assumed some default values or went with already defined ones. This is a pretty useful technique if you want to avoid excessive parsing of parameters passed directly to the batch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

file.each_line do |line| #skip the first one/not a user 3.times { next } if
I have two arrays the first one has this structure Parameter Keys array array
I have this batch file: @echo off echo StrText=Application created Successfully > spk.vbs echo
I'm surely not the first one noticed the problem below: when using the graphical
i have 2 html page the first one is the login page and the
I'm trying to read a pipe separated text file. First lines are BewerberID|Druck|Druckdatum|HistorieID|Bearbeiter|BewZuBewGruppeID|Bemerkung 12586|EinladungOFD.dot
I have a file which is composed of some 800 000 lines. Each line
I have the following commands in a batch file: C:\MI2\Stream\bin\Debug\Stream.exe 19 C:\MI2\Stream\bin\Debug\Stream.exe 20 C:\MI2\Stream\bin\Debug\Stream.exe
Further to How to Pass Command Line Parameters in batch file how does one
Is there a way for a batch file (in this case, running on Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.