I'm trying to add a customization script (batch file) that will hide the "Choose a Network" window after initial deployment of a configuration and automatically choose "Work Network" for the network type.
I have researched the registry entries that control this and have written a batch file to manipulate the appropriate keys/values.
Here is the script I have written:
@echo off
setlocal enabledelayedexpansion
If "%1%" == "precustomization" (
)
Else If "%1%" == "postcustomization" (
set THEME_REGKEY="HKLM\Software\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles"
for /f "tokens=1 delims=" %%a in ('reg query %THEME_REGKEY%') do (
REM echo KEY %%a
for /f "tokens=3" %%b in ('reg query "%%a" /v ProfileName') do (
REM echo NETWORK NAME %%b
if %%b==Network (
reg add "%%a" /v Category /t REG_DWORD /d 1 /f
reg add "%%a" /v CategoryType /t REG_DWORD /d 0 /f
reg add "%%a" /v IconType /t REG_DWORD /d 0 /f
)
)
)
)
When I run this script as a batch file, it works perfectly fine in changing the registry keys. However, when I add the code above to the Customization Script field of the template for the configuration, it does not make the same changes (or the changes get overwritten) and the "Choose a Network" box appears on first boot.
Has anyone had any experience with this issue? Is there another way to accomplish what I am trying?
Thank you.