T D Posted June 23, 2006 Share Posted June 23, 2006 Is there anyway to set a permanent environment variable via a batch file? set *=* only works during the batch.Thanks. Link to comment Share on other sites More sharing options...
egrath Posted June 23, 2006 Share Posted June 23, 2006 Hi,Environmental Variables are stored in the Registry. Current User: HKCU\EnvironmentLocal Machine: HKLM\System\CurrentControlSet\Control\Session Manager\EnvironmentUse a tool like reg.exe to modify these.Bye, Egon Link to comment Share on other sites More sharing options...
Bezalel Posted June 23, 2006 Share Posted June 23, 2006 Is there anyway to set a permanent environment variable via a batch file? set *=* only works during the batch.REG ADD "HKLM\System\CurrentControlSet\Control\Session Manager\Enviroment" /v "EnviromentVariableName" /d "EnviromentVariableValue" Link to comment Share on other sites More sharing options...
pmshah Posted June 23, 2006 Share Posted June 23, 2006 You can set it by simply going to control panel - system - advanced & selecting the environmental variable at the bottom. You can add, edit or delte required settings here. I always change this to set my temp file to an independent 5 gb partition created for this purpose. Keeps your c: drive neat & clean. You can also set user specific environment here. No need to tinker with the registry. Link to comment Share on other sites More sharing options...
egrath Posted June 23, 2006 Share Posted June 23, 2006 You can set it by simply going to control panel - system - advanced & selecting the environmental variable at the bottom. You can add, edit or delte required settings here. I always change this to set my temp file to an independent 5 gb partition created for this purpose. Keeps your c: drive neat & clean. You can also set user specific environment here. No need to tinker with the registry.Hi PMshah,the OP wanted to know if global environment variable setup is possible from within BATCH FILES, not manually.Bye, Egon Link to comment Share on other sites More sharing options...
T D Posted June 24, 2006 Author Share Posted June 24, 2006 Thanks egrath for clarification.pmshah thanks too but I wanted to know if I could automate this.REG ADD "HKLM\System\CurrentControlSet\Control\Session Manager\Enviroment" /v "EnviromentVariableName" /d "EnviromentVariableValue"Thanks Belazel, that's what I needed. Link to comment Share on other sites More sharing options...
spacesurfer Posted June 24, 2006 Share Posted June 24, 2006 I have a similar question: how do I incorporate a variable in a reg add command.For example, if I define %media% as my media drive, which is G:, how can I use that variable to change the icon of that drive using that variable instead of G.The regkey I want to modify is:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\G Link to comment Share on other sites More sharing options...
Delprat Posted June 24, 2006 Share Posted June 24, 2006 spacesurfer :@echo offset media=Greg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\%media%" /ve /d "X:\Path\To\Your\Icon.ico" /fI'm interested with that too 'coz i never see it working when set manually with regedit (icon cache rebuilt) ????++ Link to comment Share on other sites More sharing options...
spacesurfer Posted July 17, 2006 Share Posted July 17, 2006 Delprat,Finally got around to making this work.Upon a fresh install, I used the FOR command in a script to search my partitions for files called programs.tag, media.tag, images.tag, documents.tag and apply icons called programs.ico, media.ico, documents.ico and images.ico.It works perfectly. No need to rebuild cache. Hitting F5 to refresh updates the icons for those partitions. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now