i want to chance the default place of my temp folders and then delete previous temp folders and clean new temp folder
to do this, i have wrote a cmd file as follows
=========newtemp.cmd=================
md %systemdrive%\temp
rd /s /q "%userprofile%\Local Settings\Temp"
rd /s /q "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temp"
rd /s /q "%systemdrive%\Documents and Settings\Default User\Local Settings\Temp"
rd /s /q "%systemroot%\temp"
reg add newtemp.reg
DEL /F /S /Q "%systemdrive%\TEMP\*.*"
==========================
and a reg file to chance the default places for temp folders
========newtemp.reg==================
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"TEMP"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,44,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,53,00,79,00,73,00,74,00,65,00,6d,00,44,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\ControlSet001\Control\Session Manager\Environment]
"TEMP"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,44,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,53,00,79,00,73,00,74,00,65,00,6d,00,44,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\ControlSet002\Control\Session Manager\Environment]
"TEMP"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,44,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,53,00,79,00,73,00,74,00,65,00,6d,00,44,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"="%systemdrive%\\Temp"
"TMP"="%systemdrive%\\Temp"
==========================
here is the question; instead of applying registry entries with the "reg add newtemp.reg" command from my batch file, why not write it inside my newtemp.cmd file like runonceex.cmd ? in this way one cmd file is enough both cleaning temp folders and chancing the default temp folders.
but i dont know how to do that.
i tried to do it by learning the parameters from reg add /? in a cmd window but it didnt work. it allways give me "too many parameters" error.
pls show me a general info and example so that i can do it by myself...



Help

Back to top











