MSFN Forum: Found a workaround for the Network location bug - MSFN Forum

Jump to content


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

Found a workaround for the Network location bug Rate Topic: -----

#1 User is offline   ruudboek 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 14-August 04

Posted 10 June 2007 - 12:25 PM

As with a lot of people, the Network location dialog pops up when my unattended installation finishes too.
I also tried adding this RunSynchronousCommand to the specialize pass:

 
cmd /c reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 00000000 /f 


Regrettaby, as with a lot people, that workaround didn't work for me either.

I therefore decided to use the wininstall tool to take some snapshots of the registry and found out that the following reg command will prevent the Network location dialog from popping up:

Code
 
cmd /c reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" /v NetworkList /t REG_MULTI_SZ /d "" /f 


You can add this as a SynchronousCommand to the oobeSystem pass. I tested this myself and i can confirm that it works.

This workaround does have a downside: the Network location type will be set to "Public".
I have not found a way to automate changing it to "Home". I would prefer that because the option "Network discovery" would be enabled then.

Does anyone know of a command line tool, group policy or registry setting that will enable one to change the Network location?


#2 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,696
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

  Posted 10 June 2007 - 05:51 PM

That tweak tested on vpc 2007, :thumbup working very nicely as stated for me.

Thankyou.

This post has been edited by MAVERICKS CHOICE: 10 June 2007 - 05:52 PM


#3 User is offline   fletcherjames 

  • Newbie
  • Group: Members
  • Posts: 19
  • Joined: 02-June 07

Posted 11 June 2007 - 01:56 PM

ruudboek:

I think that's a hint, but I need to specify the Work location. In my environment, I'm better off to answer the extra prompt, than to hardwire the wrong answer!

I did a Google Search on NetworkList NewNetworks, hoping to find any documentation of the setting. Unfortunately, it only came up with one entry -- you post to this thread <g>.

Perhaps you could cross-post to microsoft.public.windows.vista.installation_setup, in hopes of finding an MVP with access to MS internal support.

#4 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,696
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 June 2007 - 06:16 AM

Bud if you feel so strongly bout it may be you should yourself?? Hmm.

#5 User is offline   fletcherjames 

  • Newbie
  • Group: Members
  • Posts: 19
  • Joined: 02-June 07

Posted 13 June 2007 - 08:28 AM

I'll do that -- I was just reluctant because I already posted 2 help requests there this week, and I couldn't really provide additional information about ruudeboek's experiments, if somebody asked for details.

BTW, when I posted my reply, I slipped up on the cut-and-paste, and mangled the first line which was supposed to be "Thanks! -- I think that's a hint, but like you, I need". It came out sounding as if I were being cranky.

#6 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,696
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 June 2007 - 01:27 PM

Not at all cranky.

#7 User is offline   sp00f 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 712
  • Joined: 30-November 06

Posted 11 August 2007 - 11:09 PM

In the waik help files update it says :

HELP UPDATE: Workaround for the Microsoft-Windows-Shell-Setup/OOBE/NetworkLocation setting.
The Microsoft-Windows-Shell-Setup/OOBE/NetworkLocation setting is not functioning properly. Use the following workaround to:

•	Suppress the Network Location page in Windows Welcome.
•	Prevent the Network Location dialog box from appearing after the user created in Windows Welcome logs on for the first time.
To work around the NetworkLocation setting
 1.	Run sysprep /oobe /quit /unattend:unattend.xml.
	This unattend.xml file can contain the NetworkLocation unattend setting, because it is being used to suppress the OOBE Network Location page.

2.	Create a new registry key HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork.
3.	Under this registry key, create the following values:
	•	NetworkName: REG_SZ (Name of the network)
	•	Category: REG_DWORD
	•	0 to set to public
	•	1 to set to private (maps to home/work)
	•	IconPath: REG_SZ (Icon for network)
	•	IconPath="%WINDIR%\system32\NetworkList\Icons\StockIcons\House"
	•	IconPath="%WINDIR%\system32\NetworkList\Icons\StockIcons\Office"
	•	IconPath="%WINDIR%\system32\NetworkList\Icons\StockIcons\Bench"
4.	Restart the computer.


I dont get this, can anyone explain this to me please

This post has been edited by sp00f: 11 August 2007 - 11:13 PM


#8 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,696
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 12 August 2007 - 12:49 AM

@spOOf not here either....

I recomend Rudis offering above, does it here for me...

#9 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,769
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 August 2007 - 05:59 PM

im in there already spoof, have tried several different combinations which end up with Public still
but I'm combining that with several more things I've found

#10 User is offline   sp00f 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 712
  • Joined: 30-November 06

Posted 14 August 2007 - 05:00 PM

ok, cool......

#11 User is offline   kal 

  • Member
  • PipPip
  • Group: Members
  • Posts: 114
  • Joined: 07-March 04

Posted 18 August 2007 - 06:53 AM

I'm going to try the tip provided by waik help files.
How can I know, after windows installation is completed, that my network configuration is set to Home and not Public ?

Kal

EDIT:
What does it mean

Quote

To work around the NetworkLocation setting
1. Run sysprep /oobe /quit /unattend:unattend.xml.
This unattend.xml file can contain the NetworkLocation unattend setting, because it is being used to suppress the OOBE Network Location page.


Does it mean i have to run this command during specialize pass ?

This post has been edited by kal: 18 August 2007 - 08:43 AM


#12 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,769
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 18 August 2007 - 11:02 PM

Network and Sharing Center
You'll see Network(Private Network) out to right is Customize you'll see this pic

Attached File(s)



#13 User is offline   kal 

  • Member
  • PipPip
  • Group: Members
  • Posts: 114
  • Joined: 07-March 04

Posted 19 August 2007 - 09:06 AM

All right, I finally get it working.

During specialize pass, i execute a simple batch file to specify the network icon & network name

network.cmd
cmdow @ /HID
@echo off

SET KEY=HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList

REG ADD "%KEY%\Signatures\FirstNetwork" /V "IconPath" /t REG_SZ /D "%WINDIR%\system32\NetworkList\Icons\StockIcons\House" /F
;REG ADD "%KEY%\Signatures\FirstNetwork" /V "NetworkName" /t REG_SZ /D "R‚seau" /F
;REG ADD "%KEY%\Signatures\FirstNetwork" /V "Category" /t REG_DWORD /D 00000000 /F


As you can see, i do not specify Category because it's always public, evin if i set it to 00000001. I don't either set the NetworkName because i want to keep the default one. I just set the House icon.

So, here is what I have in specialize pass to execute this batch file:
 <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	  <RunSynchronous>

		<RunSynchronousCommand wcm:action="add">
		  <Description>Detect CDROM</Description>
		  <Order>10</Order>
		  <Path>cmd /c "FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\AppsRoot.txt SETX AppsRoot %i: -m"</Path>
		</RunSynchronousCommand>
		
		<RunSynchronousCommand wcm:action="add">
		  <Description>network</Description>
		  <Order>50</Order>
		  <Path>cmd /c %systemroot%\setup\scripts\network.cmd</Path>
		</RunSynchronousCommand>
	   
	  </RunSynchronous>
	</component>


According to the tip posted in the first post, i have this in my oobe pass:
		<SynchronousCommand wcm:action="add">
		  <CommandLine>cmd /c reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" /v NetworkList /t REG_MULTI_SZ /d "" /f</CommandLine>
		  <Description>network</Description>
		  <Order>30</Order>
		</SynchronousCommand>

It's this command that will avoid the network location dialog to pop up.

Finally, I add another batch file in oobe pass to set the network location to private :
		<SynchronousCommand wcm:action="add">
		  <CommandLine>%AppsRoot%\WPI\Install\setprivate.cmd</CommandLine>
		  <Description>Set Private</Description>
		  <Order>40</Order>
		</SynchronousCommand>


setprivate.cmd:
cmdow @ /HID
@echo off
FOR /F "usebackq delims=\ tokens=8" %%i IN (`reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles"`) DO set x=%%i
REG ADD "HKLM\SOFTWARE\Microsoft\UPnP Device Host\Devices" /F
REG ADD "HKLM\SOFTWARE\Microsoft\UPnP Device Host\Providers" /F
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\%x%" /V "Category" /t REG_DWORD /D 00000001 /F
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\%x%" /V "CategoryType" /t REG_DWORD /D 00000000 /F
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\FDResPub" /V "Start" /t REG_DWORD /D 00000002 /F
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\upnphost" /V "Start" /t REG_DWORD /D 00000002 /F

shutdown /r /t 0


In this batch file, i activate FDResPub & upnphost services. Indeed, during my registry checks, i saw that the first time it switch to private from public network, these services was activating.

Be sure to reboot after running setprivate.cmd.

Hope it helps,
Kal

This post has been edited by kal: 19 August 2007 - 10:33 AM


#14 User is offline   maestrodellaves 

  • Newbie
  • Group: Members
  • Posts: 10
  • Joined: 30-April 10
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 May 2010 - 11:02 PM

That's life very complicated ... It is easier to put this line in the setupcomplete.cmd:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" /v NetworkList /t REG_MULTI_SZ /d 00000000 /f


#15 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,222
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 27 June 2010 - 09:15 PM

View Postmaestrodellaves, on 24 May 2010 - 11:02 PM, said:

That's life very complicated ... It is easier to put this line in the setupcomplete.cmd:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" /v NetworkList /t REG_MULTI_SZ /d 00000000 /f


Except for those of us who do NOT want all new networks to be considered public. Given that I know the name of the window (and the fact it'll be on the domain when it's used for the first time, where the issue occurs), I just wrote a little app to kill the window and run as part of my task sequence (as when that window occurs on a domain network, the network's already been set). Works quite well, actually, but of course as with your method, it has it's drawbacks.

I did it with simple AutoIt script that I run in my Task Sequence, for anyone interested. Yes, it is that simple:
$handle = WinGetHandle("Set Network Location", "")
WinClose($handle)


#16 User is offline   richdenis 

  • Group: Members
  • Posts: 1
  • Joined: 17-August 11
  • OS:none specified
  • Country: Country Flag

Posted 17 August 2011 - 01:10 PM

I know this thread is old but I thought I would update everyone with my successful results that result in what I had been hoping for. The ability to set the network private automatically.

The details that sp00f posted from the doc update do work once you decypher what it is saying. Basically you need to get your sysprep file the way you want it then run the sysprep utility with the generalize switch. This time though instead of reboot or shutdown, choose the "Quit" option. This will get the system prepped but leave the machine on. At this point the Key mentioned in the workaround will not exist so you will need to create it from scratch. Then you will need to add the other values.
So, key name: FirstNetwork
String Value: NetworkName with a string value. I used "Work" in mine.
DWord Value: Category with a value of 1 for private (many other people have been using 0)
String Value: IconPath with a value from the list. I chose the office Icon. Also when I added the value, I did not include the quotes around the icon, if you do it will not find the right icon. I have also attached a reg file that has the values. Hope this helps someone. Spent half my day figuring it out.

Attached File(s)


This post has been edited by richdenis: 17 August 2011 - 02:40 PM


#17 User is offline   b-man 

  • Member
  • PipPip
  • Group: Members
  • Posts: 223
  • Joined: 28-April 09

Posted 11 July 2012 - 02:56 AM

View Postrichdenis, on 17 August 2011 - 01:10 PM, said:

I know this thread is old but I thought I would update everyone with my successful results that result in what I had been hoping for. The ability to set the network private automatically.

The details that sp00f posted from the doc update do work once you decypher what it is saying. Basically you need to get your sysprep file the way you want it then run the sysprep utility with the generalize switch. This time though instead of reboot or shutdown, choose the "Quit" option. This will get the system prepped but leave the machine on. At this point the Key mentioned in the workaround will not exist so you will need to create it from scratch. Then you will need to add the other values.
So, key name: FirstNetwork
String Value: NetworkName with a string value. I used "Work" in mine.
DWord Value: Category with a value of 1 for private (many other people have been using 0)
String Value: IconPath with a value from the list. I chose the office Icon. Also when I added the value, I did not include the quotes around the icon, if you do it will not find the right icon. I have also attached a reg file that has the values. Hope this helps someone. Spent half my day figuring it out.


much thanks richdenis i see 100+ ppl downloaded it but no one has thanked you for it
hope it works i was going to try and decipher it into a reg key but you saved me the trouble worst thing with stuff like this is takes about half hr every time you want to test something on the install side as you have to wait for install to happen

when did you run this file in the xml file or in a runonce? or it shouldnt matter?

#18 User is offline   emmanux 

  • Group: Members
  • Posts: 1
  • Joined: 21-August 12
  • OS:none specified
  • Country: Country Flag

Posted 12 November 2012 - 07:27 PM

View Postb-man, on 11 July 2012 - 02:56 AM, said:

View Postrichdenis, on 17 August 2011 - 01:10 PM, said:

I know this thread is old but I thought I would update everyone with my successful results that result in what I had been hoping for. The ability to set the network private automatically.

The details that sp00f posted from the doc update do work once you decypher what it is saying. Basically you need to get your sysprep file the way you want it then run the sysprep utility with the generalize switch. This time though instead of reboot or shutdown, choose the "Quit" option. This will get the system prepped but leave the machine on. At this point the Key mentioned in the workaround will not exist so you will need to create it from scratch. Then you will need to add the other values.
So, key name: FirstNetwork
String Value: NetworkName with a string value. I used "Work" in mine.
DWord Value: Category with a value of 1 for private (many other people have been using 0)
String Value: IconPath with a value from the list. I chose the office Icon. Also when I added the value, I did not include the quotes around the icon, if you do it will not find the right icon. I have also attached a reg file that has the values. Hope this helps someone. Spent half my day figuring it out.


much thanks richdenis i see 100+ ppl downloaded it but no one has thanked you for it
hope it works i was going to try and decipher it into a reg key but you saved me the trouble worst thing with stuff like this is takes about half hr every time you want to test something on the install side as you have to wait for install to happen

when did you run this file in the xml file or in a runonce? or it shouldnt matter?



He is talking about importing it AFTER sysprepping the machine, and BEFORE shutting down it, I thought.

Share this topic:


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

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



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