Full Version: Batch File
blackP0ster
hi!

i have some problems with my litte batchfile.
i want to create a batchfile that shows my firewall status. so i thought i could write "net start" to a file and read with findstr if there exists the word "firewall" if yes the it should jump to :yes and echo yes. elso to :no and show echo no!

CODE

@echo off
net start>>temp.log
if exists findstr /C:"firewall" goto yes elso no
:yes
FIrewall is running.
pause
exit
:no
echo Your PC is not protected
pause
delete temp.log
exit


but that thing with the if findstr doesn't work. any other ideas?

thx in advance
bb
sfzhi
smile.gif
CODE

@echo off
net start|find /I "firewall"
if "%errorlevel%" == "0" goto yes
if "%errorlevel%" == "1" goto no
:yes
echo FIrewall is running.
pause
exit
:no
echo Your PC is not protected
pause
exit
blackP0ster
big thx!
works gr8 smile.gif
sirh0t
for /f "eol=; tokens=1*" %%i in (scan.txt) do If Exist vulntest.dat del vulntest.dat>NUL&xpl.exe %%i root >>vulntest.dat&type vulntest.dat | find "Listening">NUL&If Not Errorlevel 1 %%i>>vulnlist.txt

can someone help me this shit aint work
EzMe
QUOTE(sirh0t @ Jan 29 2005, 04:31 PM)
for /f "eol=; tokens=1*" %%i in (scan.txt) do If Exist vulntest.dat del vulntest.dat>NUL&xpl.exe %%i root >>vulntest.dat&type vulntest.dat | find "Listening">NUL&If Not Errorlevel 1 %%i>>vulnlist.txt

can someone help me this shit aint work
*




Sure smile.gif

Check this site


More info can be found here

Good luck biggrin.gif
hercules
Thanks,
Very Cool site wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.