Solved

Windows Batch File

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

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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 …
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

749 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