PDA

View Full Version : Apply Registry Settings to user (W2K)



myanimator
07-08-2002, 06:46 PM
This should seem like something simple but my brain is just on the fritz today...

I have a registry file created of all the tweaks I want every user to have. I want to make it when a user (other then Administrator) logs into the machine it applies this registry file to that user. Any suggestions for how to do this easily?

thx!

myanimator
07-09-2002, 08:14 PM
well my brain wokeup today and I found a simple answer. I just created a batch file that ran regedit.exe /s filename.reg (suppresed merge) and used an IF statement (IF %USERNAME%==administrator) to differ between administrator and other users.

Just thought I'd share my easy solution in case anyone else's brain goes on the fritz ;o)

POBrien
07-09-2002, 08:16 PM
Can you please post the entire contents of your batch file so we can save it in our knowledge base?

Thanks,

Patrick (http://www.winguides.com/forums/sendprivate.php?Cat=&User=POBrien&Board=&Number=&what=online&page=&view=&sb=&part=&vc=><font)</font color=green> /images/forums/icons/smile.gif
<a target="_blank" href=http://www.winguides.com/subscribe/?guide=registry>WinGuides</a>

myanimator
07-09-2002, 08:38 PM
No Worries Patrick... it is very simple though, don't know if it is worthy of any archiving ;)

<font color=blue>@ECHO OFF
IF %USERNAME%==administrator GOTO Admin

regedit.exe /s user.reg
exit

:Admin
regedit /s admin.reg
exit</font color=blue>

The :Admin part allows me to add a registry file for the administrator just in case for things like command line completion. I selected for this to Run as Minimized so the user sees nothing and it only takes a fraction of a second to run anyhow.

/images/forums/icons/laugh.gif

POBrien
07-09-2002, 11:21 PM
Right on.

Thanks MA!

Pat

ironpaw
07-09-2002, 11:51 PM
I use this to change all existing and new users. It works great.


c:
cd \"Documents and Settings"
for /D %%d in (*) do call :update %%d
goto end

:update

if %1 == Administrator goto end
if %1 == All goto end
set UNAME=%1
if %1 == Default set UNAME=Default User

echo Updating User %UNAME%

REG LOAD HKLM\CYF "C:\Documents and Settings\%UNAME%\NTUSER.DAT"
echo y |reg add "HKLM\CYF\Software\Microsoft\Internet Connection Wizard" /v "Completed" /t REG_BINARY /d 1
echo y |reg add "HKLM\CYF\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d http://triys007/
REG UNLOAD HKLM\CYF

goto end

:end

POBrien
07-10-2002, 12:00 AM
Thanks for posting that IronPaw. Where did you get the scripting syntax? A book or another site?

Pat

tomokita
07-10-2002, 04:44 AM
please help (WIN2K). I put REG_SZ: regedit /s c:\winnt\scrnsave.reg in HKCU\Software
\Microsoft\Windows\CurrentVersion\Run for users to import reg file but error occurs telling Cannot import scrnsave.reg. I gave him poweruser priviledge but it didn't work.

POBrien
07-10-2002, 06:36 AM
The cacls command is from page 766 in the windows 2000 resource kit.

It is used to change access control lists for files and folders.

I haven't tried this out yet because I currently do not have 2000 installed.

Copy everything between the lines below into notepad and save as import.bat


_________________________________________________

c:
cd\ "Documents and Settings\%USERNAME%"

cacls NTUSER.DAT /e /c /g %USERNAME%:F

regedit /s c:\winnt\scrnsave.reg

cacls NTUSER.DAT /e /c /g %USERNAME%:R
_________________________________________________

You can use the bat file and reg file to complete the change.

You can also type cacls /? at the command line for additional syntax options.

Let us know how you go.

Patrick (http://www.winguides.com/forums/sendprivate.php?Cat=&User=POBrien&Board=&Number=&what=online&page=&view=&sb=&part=&vc=><font)</font color=green> /images/forums/icons/smile.gif
<a target="_blank" href=http://www.winguides.com/subscribe/?guide=registry>WinGuides</a>