Solved

Windows Batch File

Posted on 2013-11-19
1
517 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now