I would like to create a new registry key to add the current computer name to the internet explorer trusted sites in windows 2008r2 x64
My server is called "MyServerName" in a batch file if I type echo %hostname% it return MyServerName but in the registry command it doesnt work it create the key using "%hostname%" instead of "MyServerName"
Here is the command I tried :
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\%hostname%" /v http /t REG_DWORD /d 00000002 /f
I would expect the key to be created to look more like this:
Any help would be appreciated, I tried digging to find info on how to do this but couldn't find anything that would solve my problem.
In case you wonder, we have an application that needs to run locally and use the server hostname to access a website and apparently for IE MyServerName is different from localhost even if localhost is already in the trusted site.