@turcotter TBH, I did not look at the first script. I just did take a peek and this should work for you. I just got rid of the intents.
@Echo Off
Set csv=\\Server\Share\pcsetup\ipchanger\ComputerList.csv
for /f “skip=1 delims=, tokens=1-7” %%a in (%csv%) do (
if /I “%computername%”=="%%a" (
netsh int ipv4 set address “Local Area Connection” static %%b %%c %%d
netsh int ipv4 set dnsserver “Local Area Connection” static %%e
netsh int ipv4 add dnsserver “Local Area Connection” %%f
netsh int ipv4 add dnsserver “Local Area Connection” %%g
)
)
REM Pause
Echo On
Now for the csv file. It looks like it takes on this form from the script
computer_name, ip_addr, subnet_mask, gateway,dns_server1, dns_server2, dns_server3
computer1, 192.168.1.20,255.255.255.0,192.168.1.1,192.168.1.50,192.168.1.52,192.168.1.55
No need for headers unless a human needs to read it. The script will look for a line that matches the current computer name in the .csv file and then set the parameters accordingly.
Just be aware you will have the same issue as the OP of the thread I linked, the snapin runs as the SYSTEM user, which is a local admin user that has no domain rights. You will need to map a drive to the remove CSV file, or just include it with the snapin then not need to worry about connecting to an external share.