Takafoo 0 Light Poster

Apologies if this is in the wrong section.

I'm trying to create a batch file to run on a PC for setup purposes.

It needs to set the IP and Computer and Workgroup.

So far IP and Computer name work until a restart when the IP settings appear to drop out. I then need to go into the Newtork Settings -> TCP/IP Properties -> Advanced and just 'OK' out of there without changing it, then when I restart there are no issues. Can anyone help me with why this would be and how I can fix it?

Also,

If anyone is able to help with how to set a Workgroup from a batch file?

@ECHO OFF
set /p ip3=Please enter your store reference #:
set /p ip4=Please enter your lane # (Lane 4 = 04):
set sm=255.255.255.0

ECHO.
ECHO Setting IP Address and Subnet Mask
netsh int ip set address name = "Local Area Connection" source = static addr = 10.23.%ip3%.%ip4% mask = %sm%
ECHO.
ECHO Setting Gateway
netsh int ip set address name = "Local Area Connection" gateway = 10.23.%ip3%.254 gwmetric = 1
netsh int ip set dns name = "Local Area Connection" source = static addr =
ECHO.
ECHO Change Computer Name
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName /v ComputerName /t REG_SZ /d CHECKOUT%ip4% /f
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName /v ComputerName /t REG_SZ /d CHECKOUT%ip4% /f
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName /v ComputerName /t REG_SZ /d CHECKOUT%ip4% /f
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /V Hostname /t REG_SZ /d CHECKOUT%ip4% /f
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /V "NV Hostname" /t REG_SZ /d CHECKOUT%ip4% /f
ECHO.
ECHO Here are the your settings:
netsh int ip show config
ECHO.
ECHO Please restart the PC to apply new settings.
pause