Jump to content

Using batch to add to the registry


Recommended Posts

I have an issue with my computer where the wireless adapter doesn't automatically "turn on". In an effort to overcome this, it's been discovered that by turning on the Wireless Zero Configuration Service, and clicking the checkbox "Use Windows to configure my wireless network settings", the computer can connect to the internet. Recently though, I've been trying to come up with a batch script to do just those things to re-automate the process. I researched what I think is the appropriate solution, but I'm unsure if it actually is. From what I read, the equivalent to checking the checkbox is changing a value in the registry. I've copied the value and also exported the appropriate .reg file. My question here is how can I modify the existing value to what it needs to be using a batch script, if that is the solution that I need?

Here's the registry path, key, and value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WZCSVC\Parameters\Interfaces\{FE2C0402-92E9-4CE3-9379-27A63FB88001}

"ControlFlags"="0f918002"

I greatly appreciate the help in advance.

Link to comment
Share on other sites


From what I read, the equivalent to checking the checkbox is changing a value in the registry. I've copied the value and also exported the appropriate .reg file. My question here is how can I modify the existing value to what it needs to be using a batch script, if that is the solution that I need?

Here's the registry path, key, and value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WZCSVC\Parameters\Interfaces\{FE2C0402-92E9-4CE3-9379-27A63FB88001}

"ControlFlags"="0f918002"

I am not sure to get the actual question. :unsure:

You should have TWO .reg files, one with the *whatever* switched ON, and one with the *whatever* switched OFF.

As uid0 pointed out you can use both regedit or reg.exe to merge one or the other to the registry, but if you have .reg filetype registered correctly you can also double click on the .reg files, just in case:

http://ask-leo.com/how_do_i_get_a_reg_file_to_install.html

But do you need a batch to right the value "on the fly " or to merge an existing .reg?

REG ADD will write a key or value

REG IMPORT will import a .reg file

jaclaz

Link to comment
Share on other sites

The value you've provided for the ControlFlags is for the enabled adaptor, (the disabled value should be dword:0f910002 or "261160962")

I would suggest that in order to perform the task you'd need to

  • Query the value in the registry and check if disabled using your known values.
  • If the value shows disabled
    • check if the Windows Zero Configuration Service is running and stop it if it is.
    • Apply the known value to the registry.
    • Start/restart the WZC service

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...