Computing.Net > Forums > Windows XP > Change TEMP variables for all users

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Change TEMP variables for all users

Reply to Message Icon

Name: johnye_pt
Date: March 1, 2009 at 21:00:48 Pacific
OS: Windows XP
Subcategory: Configurations
Comment:

Hi.

I've been googling all day but i couldn't find a solution for what i need.

I want to create a .reg file to use (among other .reg files) after a fresh windows xp installation so all new created accounts point TEMP and TMP variables to C:\TEMP (%systemdrive%\TEMP).

I successfully changed System variables using this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"TEMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,\
00,65,00,25,00,5c,00,54,00,45,00,4d,00,50,00,00,00
"TMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,00,\
65,00,25,00,5c,00,54,00,45,00,4d,00,50,00,00,00

But i can't change User variables. I tried changing [HKEY_USERS\.DEFAULT\Environment] but that didn't work.

I read somewhere that i would have to open regedit, load ntuser.dat from the default user, change the variables inside and save it, but i don't think i can do that from a .reg file or a batch file.

Any suggestions?

I only do what the voices in my head command...



Sponsored Link
Ads by Google

Response Number 1
Name: johnye_pt
Date: March 1, 2009 at 21:16:01 Pacific
Reply:

This suggesion works, but it was to be manually done:

1) Modify Explorer settings to let you see hidden files
2) Go to Start-> Run -> type regedit
3) In the left pane of Registry Hightlight HKEY_USERS
4) Go to File -> Load Hive
5) Look in C:\Document and Settings\Default users and import ntuser.dat (name it Default user)
6) Look for key HKEY_USERS\Default user\Environment
7) modify TEMP and TMP to C:\TEMP
8) Unload Hive

This works exactly like i want it to. All newly created accounts after this use C:\TEMP in User Variables.

How do i make a batch file to automate this steps?

I only do what the voices in my head command...


0

Response Number 2
Name: wanderer
Date: March 1, 2009 at 21:29:30 Pacific
Reply:

Undersand that by doing so you compromise the security on every system this is applied to. Now what used to be temp per profile is temp for all to see.


0

Response Number 3
Name: johnye_pt
Date: March 1, 2009 at 21:35:37 Pacific
Reply:

Found it.

Batch file will need this:

reg load HKU\TempHive "C:\Documents and Settings\Default User\NTUSER.DAT"
regedit.exe /s temp_variables.reg
reg unload HKU\TempHive
md C:\TEMP

Reg file will be like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"TEMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,\
00,65,00,25,00,5c,00,54,00,45,00,4d,00,50,00,00,00
"TMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,00,\
65,00,25,00,5c,00,54,00,45,00,4d,00,50,00,00,00

[HKEY_CURRENT_USER\Environment]
"TEMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,\
00,65,00,25,00,5c,00,54,00,45,00,4d,00,50,00,00,00
"TMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,00,\
65,00,25,00,5c,00,54,00,45,00,4d,00,50,00,00,00

[HKEY_USERS\Temphive\Environment]
"TEMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,\
00,65,00,25,00,5c,00,54,00,45,00,4d,00,50,00,00,00
"TMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,00,\
65,00,25,00,5c,00,54,00,45,00,4d,00,50,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\...] changes System variables;
[HKEY_CURRENT_USER\Environment] changes current user variables;
[HKEY_USERS\Temphive\Environment] changes default profile user variables.

All i needed was to be half asleep to find the solution... :)

I only do what the voices in my head command...


0

Response Number 4
Name: wanderer
Date: March 2, 2009 at 08:09:30 Pacific
Reply:

And what was the problem you were trying to address?


0

Response Number 5
Name: johnye_pt
Date: March 2, 2009 at 09:03:52 Pacific
Reply:

As i said in the first post, "I want to create a .reg file to use (among other .reg files) after a fresh windows xp installation so all new created accounts point TEMP and TMP variables to C:\TEMP (%systemdrive%\TEMP)".

Problem solved in Response Number 3, all i needed was to load Default User's HIVE and change TEMP variables in it, so future accounts use the new path.

I only do what the voices in my head command...


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Change TEMP variables for all users

Change screen saver for all users www.computing.net/answers/windows-xp/change-screen-saver-for-all-users/160009.html

Changing Homepage for All Users www.computing.net/answers/windows-xp/changing-homepage-for-all-users/138579.html

network settings for all users www.computing.net/answers/windows-xp/network-settings-for-all-users/86339.html