check registry values and firewall rules [solved]

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

check registry values and firewall rules [solved]

#1 Post by abc0502 » 04 Mar 2012 09:55

how to check for a certain registry value and firewall rule using batch file :?:
Last edited by abc0502 on 12 Mar 2012 00:30, edited 1 time in total.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: check registry values and firewall rules

#2 Post by aGerman » 04 Mar 2012 10:26

Depends on what exactly you're looking for.
REG QUERY to read registry values.
NETSH ADVFIREWALL to define or get settings about the firewall.
try

Code: Select all

netsh advfirewall firewall show rule name=all type=dynamic

Regards
aGerman

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: check registry values and firewall rules

#3 Post by abc0502 » 04 Mar 2012 10:34

Thanks Worked fine :D
This is how for any one else want the code:

Code: Select all

netsh advfirewall firewall show rule name="uTorrent" >nul
if %errorlevel%== 0  ECHO uTorrent Firewall Rule Exist
) Else ( ECHO uTorrent Firewall Rule Doesn't Exist )


The Registry

Code: Select all

set a=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
REG QUERY "%a%" /v "uTorrent" /s >nul
if %errorlevel%== 0 ( ECHO uTorrent Startup Entry Exist
) Else ( ECHO uTorrent Startup Entry Doesn't Exist )

replace the rule name in firewall and the startup entry name in registry with your program and the message after ECHO

yaiohena
Posts: 1
Joined: 25 May 2012 01:03

Re: check registry values and firewall rules [solved]

#4 Post by yaiohena » 04 Jun 2012 00:36

How to have utorrent finish a torrent download from Bittorrent? I'm switching over from using Bittorrent to utorrent, but I have a huge unfinished file to download that's halfway through. I don't wanna start it over, so I need to know how I can have utorrent finish it (w/o accidently reseting the download to 0%). So, what do I need to do to have utorrent finish my Bittorrent download?

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: check registry values and firewall rules [solved]

#5 Post by Dos_Probie » 18 Jun 2012 11:44

Good Stuff!!

But how can I add an exception in Windows Firewall for a program via your code and reg??
ex. say I want to add a startup entry for uTorrent... :?:

miskox
Posts: 553
Joined: 28 Jun 2010 03:46

Re: check registry values and firewall rules [solved]

#6 Post by miskox » 19 Jun 2012 16:29

@yaiohena:

This is offtopic, but utorrent was mentioned above so:

I would do this:

1. Maybe you could make a backup of these partialy downloaded files?
2. open this .torrent file with uTorrent - make sure download location is the same. Also make sure it does *not* start.
3. right click on the torrent and select Recheck (or something like this).
4. It should start checking what you have - it should finish with the same downloaded value - if not then it would mean that your download location is not the same.
5. When it finishes just click Start or Force start.

This is confirmed to be working.

Saso

Post Reply