Advertisement

08.21.2008 at 06:59AM PDT, ID: 23666740
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Batch script to parse "ipconfig /all" and create .reg file

Asked by edcommit in Windows Batch Scripting

Tags:

Hi all, I have a need for the batch script and am limited in my knowledge of it. I was hoping someone could help me write it, or at least the parsing portion of it. It needs to do following:
 
1a. Runs "ipconfig /all" and parses out the SID# of the virtual adapter for the Check Point SecureClient we have installed. A typical output from one of our computers with Check Point SecureClient installed looks like this:
 
          Windows IP Configuration
         
         
                  Host Name . . . . . . . . . . . . : Edcomm127
                  Primary Dns Suffix  . . . . . . . : edcomm.local
                  Node Type . . . . . . . . . . . . : Unknown
                  IP Routing Enabled. . . . . . . . : No
                  WINS Proxy Enabled. . . . . . . . : No
                  DNS Suffix Search List. . . . . . : edcomm.local
           
         
          Ethernet adapter Local Area Connection:
         
         
                  Connection-specific DNS Suffix  . : edcomm.local
                  Description . . . . . . . . . . . : Broadcom NetXtreme 57xx Gigabit Controller
                  Physical Address. . . . . . . . . : 00-1D-09-C5-BA-E4
                  Dhcp Enabled. . . . . . . . . . . : Yes
                  Autoconfiguration Enabled . . . . : Yes
                  IP Address. . . . . . . . . . . . : 192.168.0.147
                  Subnet Mask . . . . . . . . . . . : 255.255.255.0
                  Default Gateway . . . . . . . . . : 192.168.0.251
                  DHCP Server . . . . . . . . . . . : 192.168.0.245
                  DNS Servers . . . . . . . . . . . : 192.168.0.245
                                                      192.168.0.247
         
                  Lease Obtained. . . . . . . . . . : Wednesday, August 20, 2008 3:44:45 PM
                  Lease Expires . . . . . . . . . . : Saturday, August 23, 2008 3:44:45 PM
           
         
          Ethernet adapter Wireless Network Connection:
           
         
                  Media State . . . . . . . . . . . : Media disconnected
                  Description . . . . . . . . . . . : Dell Wireless 1490 Dual Band WLAN Mini-Card
                  Physical Address. . . . . . . . . : 00-1F-3A-37-C8-0B
           
         
          Ethernet adapter {5B935B46-FBE6-4587-BA4C-990CE75D37C0}:
           
         
                  Media State . . . . . . . . . . . : Media disconnected
                  Description . . . . . . . . . . . : Check Point Virtual Network Adapter For SecureClient - SecuRemote Miniport
                  Physical Address. . . . . . . . . : 54-5F-FA-56-29-09
 
1b. We want the number between the brackets {} for the bottom most adapter in this example, the "Check Point Virtual Network Adapter For SecureClient". So the batch script should pull out the "5B935B46-FBE6-4587-BA4C-990CE75D37C0". But some computers may have additional adapters that return SID numbers similar to that, so if there is a way to have the batch search for the "Check Point Virtual Network Adapter for SecureClient" string... and then back up a few lines and grab the SID between the brackets {}, that would be preferable.
 
2a. The script would then create a .reg file that would change the registry DWORD values of "RegisterAdapterName" and "RegistrationEnabled" to 1. Example code from an exported .reg below:
 
          [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B935B46-FBE6-4587-BA4C-990CE75D37C0}]
          "RegistrationEnabled"=dword:00000001
          "RegisterAdapterName"=dword:00000001
 
2b. As you can see the SID number that was retrieved earlier needs to be placed into the top line of the .reg file so the registry changes the values for the correct interface.
 
3. The batch script then needs to run the .reg file without any user interaction and install the changes. (/S parameter when running regedit.exe from command-line)
 
NOTE #1: If the registry changes can be made directly from the batch script using commands without creating a .reg file for importing, that is fine too.
 
NOTE #2: This link may help with using regedit within a batch script: http://www.robvanderwoude.com/regedit.htmlStart Free Trial
 
Keywords: Batch script to parse "ipconfig /all" …
 
Loading Advertisement...
 
[+][-]08.21.2008 at 11:37AM PDT, ID: 22282841

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Windows Batch Scripting
Tags: Batch
Sign Up Now!
Solution Provided By: Shift-3
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.21.2008 at 12:32PM PDT, ID: 22283479

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 12:44PM PDT, ID: 22283592

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 01:02PM PDT, ID: 22283782

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 01:17PM PDT, ID: 22283915

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628