Adding File Server to Trusted Sites through REG ADD Command

batchwindows 7windows-registry

I'm trying to add a trusted site to a group of Win 7 computers that need to run batch files without security prompts.

Adding the file server to trusted sites allows them to run. I don't want to manually add the site to 100 computers so I'd like to script it with "REG ADD" but it's not working. MY syntax is as follows:

Hostname of FS is "Our-File-Server"

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\Our-File-Server" /v "file" /t REG_DWORD /d 00000002 /Y

This returns Invalid Syntax

Best Answer

As per reg add /?, there is no /Y option. To force overwriting the existing registry entry without prompt, use /f instead.

Truly, I don't know whether this setting will allow running batch scripts without security prompts. I'd add that option manually and prove its functionality first (on any machine) and then check appropriate registry changes as follows:

REG query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\Our-File-Server"