Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Using batch to add to the registry

- - - - -

  • Please log in to reply
3 replies to this topic

#1
al1290

al1290
  • Member
  • 1 posts
  • Joined 25-April 12
  • OS:XP Home
  • Country: Country Flag
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.


How to remove advertisement from MSFN

#2
uid0

uid0

    Advanced Member

  • Member
  • PipPipPip
  • 357 posts
  • Joined 12-June 06
regedit /s name-of-file.reg
or
reg add /?

#3
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,593 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

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/h...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

#4
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,546 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users