How to setup MCR_CACHE_ROOT in Windows - windows

I know this may be an easy question but How can I setup MCR_CACHE_ROOT in Windows? Can you provide me with the detailed steps. And where should I point the path to MCR_CACHE_ROOT to speed up my compiled application startup time?

For Windows 7, you set it as an environment variable as follows:
Click Start then right-click on Computer and choose Properties from the menu.
In the System window, click Advanced system settings in the left panel.
In the System properties dialog, select the Advanced tab and click the Environment variables button.
To add for all users, click New under the System variables window.
For Windows XP it's very similar and is described here.
Then you can enter MCR_CACHE_ROOT as the variable name, and the required path to variable value. Ok everything and it's done.
You can set the path wherever you like, but it's probably better to create a folder e.g. C:\MATLAB Cache and set it there.

Related

programmatically open 'system properties'

How can I open the various windows in system properties from command line or using VBS or JS?
By this I mean windows such as User Profiles, environment variables, performance options, DEP, hardware profiles, windows update settings, remote desktop settings, etc I am using windows XP but it wont let me create a shortcut to these dialogs. Sysdm.cpl cant do it either it seems.
System properties is the window that opnes when you right click my computer and hit properties.
One way to open the edit environment variables of the windows through the command line would be to call the run.exe:
"C:\Windows\system32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables
So there must be something similar for other windows.
You can also open a specific tab of the system properties window by using the control command and the tab number:
control sysdm.cpl,,3

git-cheetah modifying path environment variable multiple times

Just wanna find out if anyone has had a similar experience to this.
Git seems to be modifying my path environment variable, hereafter referred to as $path, such that if after having my system running for a few days the $path is 1 huge mess!
After a clean boot $path looks something like this:
D:\WINDOWS\system32;D:\WINDOWS;D:\Apps\Development\Git\cmd;D:\Apps\Development\Android\android-sdk\platform-tools;D:\Apps\Development\phantomjs-1.9.7-windows;D:\Apps\Tools\GnuWin32\bin
When it gets to the state I mentioned it looks something like this:
D:\Apps\Development\Git\git-cheetah..\bin;D:\WINDOWS\system32;D:\WINDOWS;D:\Apps\Development\Git\cmd;D:\Apps\Development\Android\android-sdk\platform-tools;D:\Apps\Development\phantomjs-1.9.7-windows;D:\Apps\Tools\GnuWin32\bin
Except that the D:\Apps\Development\Git\git-cheetah..\bin bit is repeated, sometimes (what looks like) over 50 times!
Any insight into this would be much appreciated
First of all, apologies that this is more of a workaround than an answer. I am experiencing the same exact issue. Eventually my PATH gets so large that my programs can't find anything, even as simple as XCOPY.
This is happening to me on my work computer which is under domain control and I don't have admin permissions. These instructions assume no admin access, strictly user access.
In order to avoid restarting I perform the following:
Prior to performing these steps you can open command window and run set PATH to verify that you have too many cheetahs.
Go to the Environment Variables dialog (Right-Click "My Computer" -> Choose "Properties" -> Select the "Advanced" tab -> Click the "Environment Variables" button).
Select "PATH" variable under the "User variables for <username>" section.
Click then "Edit" button under the same section.
Do nothing
Click OK in the "Edit User Variable" dialog box.
Click OK in the "Environment Variables" dialog box.
Click OK in the "System Properties" window.
Open a NEW command window (command windows that were already open may preserve their current environment) and run 'set PATH' to verify that you're back to none or one 'cheetah's in your path.
I had the same annoying problem. Just download git-cheetah source, open common/winexec.c and on line 262 change from:
if (path.len) {
setenv("PATH", path.buf, 1);
rec->envpath = strbuf_detach(&path, NULL);
}
to:
if (path.len) {
if (!strstr(getenv("PATH"), gitpath))
setenv("PATH", path.buf, 1);
rec->envpath = strbuf_detach(&path, NULL);
}
Then, recompile (cd explorer, mingw32-make) and copy the generated dll over the existing one in Program files\Git\git-cheetah. If the file is in use you can open a console window, close the Explorer process and copy using command line; then, restart explorer using the task manager (File->Execute).

Where is the path information in DOS saved

I had recently entered set path = c:\TC\bin;%path%. Thereafter entering path got this path = c:\tc\bin;BLAH-BLAH; and it worked. I closed command and reopened it does not work and on checking I get path=BLAH-BLAH; only. The recent addition I made was not present. Any clues? Thanks.
Environment variables are saved in a registry setting.
When you edit an environment variable in a command shell, the change only applies to that command shell (as you found).
If you want to set the path for the whole system you need to set it centrally - in Windows XP you can right click on "My Computer", choose "Properties", "Advanced" then click on "Environment Variables" at the bottom, and similar methods apply to other Windows sytems.
If you want to edit it programmatically you would need to do this through the registry APIs. There are answers about how to do this here: Programmatically modifiy environment variables?

Windows 7: Set "Copy Settings" programmatically from a batch file

I'm constructing a batch file that will auto-configure Windows 7's regional settings for all users.
So far, I've successfully been able to set (mostly) all of the regional settings for the current user, but I need to be able to apply the same settings to all new users. You can do this via the GUI, by going into Region and Language > Administrative > Copy Settings and selecting both checkboxes. I would like to do this programmatically, though. Does anyone know of a registry key I can set or something that will do this?
Failing that, I'll settle for a way to programmatically open the Region and Language > Administrative > Copy Settings window. I've been able to successfully open the Region and Language > Administrative window with start rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,3, but I would like to eliminate one more step from the process, if possible.
Update
Sorry, I seem to have forgotten to mention how I'm applying these settings. I'm doing this by executing an exported .reg file, that contains the optimal settings, with regedit.exe /s "regional.reg"
How are you applying the settings now? Via the registry?
If you put the settings under HKEY_USERS\.DEFAULT instead of (or in addition to) HKEY_CURRENT_USER, they should be used during profile creation.

How to set user environment variables in Windows Server 2008 R2 as a normal user?

In older versions of Windows, it was just open the Control Panel, select the System applet, select the Advanced tab, and then hit the Environment variables button. As a normal user, you could edit the "User variables" but not the "System variables".
In Windows Server 2008 R2, if I try to hit the Advanced System settings option in the System applet, it prompts for the Administrator password.
You can also use this direct command line to open the Advanced System Properties:
sysdm.cpl
Then go to the Advanced Tab -> Environment Variables
OK I found it. Arg, an exercise in frustration. They left the old window menu traversal path for changing environment variables in there, but limited access to administrators only. As a normal user, if you want to change it, you need to go through a different set of options to arrive at the same frigging window.
Control Panel -> User Accounts -> User Accounts -> Change my environment variables.
Step by step instructions:
Go to Control Panel \System and Security\System
Click on Change Settings
Go to “Advance” tab
Click on Environment Variables
Under "Start" enter "environment" in the search field. That will list the option to change the system variables directly in the start menu.
This can be done from the command line using the SETX command. For example to 'move' your temporary files to another disk:
SETX TEMP d:\tmp
In command line prompt:
set __COMPAT_LAYER=RUNASINVOKER
SystemPropertiesAdvanced.exe
Now you can set user environment variables.
I created a godmode folder on the desktop. just create a new folder on the desktop and call it GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
it will name the folder as godmode and populate the content with various config options, you can then just type in ENVIRO in the search to find the relevant config option, open it and it opens sysdm.cpl in the advanced tab, you can change the environment variables from there.
There are three ways
1) This runs the GUI editor for the user environment variables. It does exactly what the OP wanted to do and does not prompt for administrative credentials.
rundll32.exe sysdm.cpl,EditEnvironmentVariables
(bonus: This works on Windows Vista to Windows 10 for desktops and Windows Server 2008 through Server 2016. It does not work on Windows NT, 2000, XP, and 2003. However, on the older systems you can use sysdm.cpl without the ",EditEnvironmentVariables" parameter and then navigate to the Advanced tab and then Environment Variables button.)
2) Use the SETX command from the command prompt. This is like the set command but updates the environment that's stored in the registry. Unfortunately, SETX is not as easy to use as the built in SET command. There's no way to list the variables for example. Thus it's impossible to do something such as appending a folder to the user's PATH variable. While SET will display the variables you don't know which ones are user vs. system variables and the PATH that's shown is a combination of both.
3) Use regedit and navigate to HKEY_CURRENT_USER\Environment
Keep in mind that changes to the user's environment does not immediately propagate to all processes currently running for that user. You can see this in a command prompt where your changes will not be visible if you use SET. For example
rem Add a user environment variable named stackoverflow that's set to "test"
setx stackoverflow test
set st
This should show all variables whose names start with the letters "st". If there are none then it displays "Environment variable st not defined".
Exit the command prompt and start another. Try set st again
and you'll see
stackoverflow=test
To delete the stackoverflow variable use
setx stackoverflow ""
It will respond with "SUCCESS: Specified value was saved." which looks strange given you want to delete the variable. However, if you start a new command prompt then set st will show that there are no variables starting with the letters "st"
(correction - I discovered that setx stackoverflow "" did not delete the variable. It's in the registry as an empty string. The SET command though interprets it as though there is no variable. if not defined stackoverflow echo Not defined says it's not defined.)

Resources