Solved

Windows Batch File

Posted on 2013-11-19
1
522 Views
Last Modified: 2013-11-21
Experts,
I need some assistance in creating a Windows batch file that needs to run on startup:

I have an environment variable called EWF which will be set to either 0 or 1; I need the batch file to query the environment variable and perform some actions if it's a 0 or do nothing if it is a 1.

Any help?
0
Comment
Question by:arunykand
1 Comment
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 39660219
This line will leave the batch script immediately if EWF is 1, and continue otherwise:
if "%EWF%"=="1" goto :eof
echo EWF is 0

Open in new window

Or you can do something like this:
if "%EWF%"=="0" (
	echo EWF is 0
)

Open in new window

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question