You can use the following commands in a batch file (.bat file) Use of batch files relieves you from making so many UI clicks to perform a simple task of assigning a value to "Use automatic configuration script" text box in the internet options -> Advanced settings.
To use an automatic config script
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "http://www.xxxxx.com:1234/sampleScript" /f
The result looks like:
To clear that field
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "" /f