Jump to content

Found a workaround for the Network location bug


Recommended Posts

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?

Link to comment
Share on other sites


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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...

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

Edited by sp00f
Link to comment
Share on other sites

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

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 ?

Edited by kal
Link to comment
Share on other sites

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

Edited by kal
Link to comment
Share on other sites

  • 2 years later...
  • 1 month later...

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)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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