MSFN Forum: Using batch to add to the registry - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Using batch to add to the registry Rate Topic: -----

#1 User is offline   al1290 

  • Group: Members
  • Posts: 1
  • Joined: 25-April 12
  • OS:XP Home
  • Country: Country Flag

Posted 25 April 2012 - 04:39 AM

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.


#2 User is offline   uid0 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 348
  • Joined: 12-June 06

Posted 25 April 2012 - 06:35 AM

regedit /s name-of-file.reg
or
reg add /?

#3 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,420
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 25 April 2012 - 08:59 AM

View Postal1290, on 25 April 2012 - 04:39 AM, said:

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 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,363
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 25 April 2012 - 11:33 AM

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


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy