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