I need to programmatically set the Internet Explorer home page for all local users (no domain). Can this be accomplished via a batch file, through C#, or through some other method that does not involve a gui?

Dani AI

Generated

Two practical approaches (pick one): enforce a machine-wide policy (recommended if you want the same, unchangeable home page for everyone) or update each user’s registry hive (existing profiles and the Default profile) so the value is present per user. is correct that the setting lives in each user’s registry hive; that’s why the two approaches exist. Note: Internet Explorer desktop has been retired/disabled on many Windows releases, so prefer Edge/IE‑mode where possible. (borncity.com)

Machine-wide (enforced) — easiest to script and prevents users changing it:

  • Write the IE policy under the machine Policies branch so it applies to every local user and is enforced. Example one‑liner (run elevated):
reg add "HKLM\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "https://intranet.example.local" /f
  • After setting it, force a policy refresh or have users sign off/on; a reboot or gpupdate can be used during testing. On 64‑bit systems, ensure your script runs the 64‑bit reg.exe (use %windir%\Sysnative\reg.exe from a 32‑bit host) to avoid redirection. (learn.microsoft.com)

Per-user hives (bulk update existing + default for new accounts) — useful when you want the value in each profile rather than an enforced policy:

  • Load each NTUSER.DAT, set the value inside that hive, then unload. The reg load / reg unload commands let you edit offline hives; edit the Default user NTUSER.DAT to affect new profiles. Example (run as admin; back up NTUSER.DAT first):
@echo off
set URL=https://intranet.example.local

for /d %%P in ("C:\Users\*") do (
  if exist "%%P\NTUSER.DAT" (
    reg load HKU\TempHive "%%P\NTUSER.DAT"
    reg add "HKU\TempHive\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "%URL%" /f
    reg unload HKU\TempHive
  )
)
  • Loading hives programmatically requires appropriate privileges and care (don’t edit a hive for a user that’s logged on; always test on one profile). Use the documented reg load/unload APIs or RegLoadKey (privilege requirements) or the PowerShell/module helpers for offline hives. (learn.microsoft.com)

Quick troubleshooting checklist:

  • Back up NTUSER.DAT before changing it.
  • Test on one machine/profile first.
  • Policy changes may require gpupdate /force or user logoff/logon to take effect; hive edits only affect that profile (or new profiles if you modify Default). Monitor with gpresult if needed. (learn.microsoft.com)

If needed, a small C# helper can P/Invoke the RegLoadKey/RegUnLoadKey APIs to automate the hive‑mount/edit/unmount cycle; make sure the process holds the required privileges.

The value is stored in the registry under the following key:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page

and additional "start" urls (tabs) are in:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Secondary Start Pages

Click Here for a powershell script.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.