batch file - Reg add for loop -


sorry if question has been asked before, haven't been able find answer can understand , apply.

i'm writing batch file installs application, , need batch file add registry key in software key every profile in hkey_users hive.

i've been able use reg add add key logged on user, because our desk running batch file elevated command prompt, change not affect user needs run application.

this had reg add

reg add "hkcu\software\application" /v "current practice" /t reg_sz /d "\\server\share"

any suggestions?

you need load user's hive registry before can modify it:

@echo off  setlocal  set "hive=hku\temp" set "key=software\application" set "value=current practice" set "data=\\server\share"  /d %%u in (c:\users\*) (   if exist "%%~u\ntuser.dat" (     reg load %hive% "%%~u\ntuser.dat"     reg add "%hive%\%key%" /v "%value%" /t reg_sz /d "%data%" /f     reg unload %hive%   ) ) 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -