environment-variables

[Visual Studio 2003] Setting environment variables in pre-build event and using in compilation step

In Visual Studio 2003, I am trying to set an environment variable in the pre-build event that will then be used in the compilation step, but the value doesn't seem to be propagated. For example, if the pre-build event contains this (either directly or within a batch file): set MY_LIB_VERSION=1.0.0 and AdditionalIncludeDirectories has...

Open txt file from C# application

The following code is suppose to open CMD from my C# application and open the file text.txt. I tried to set the file path as an environment variable but when notepad opens it looks for %file%.txt instead of text.txt Any idea why? System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents=false...

OSX: Environment variables pointing to application bundles?

I want cscope to open files in MacVim instead of vim, so I'm trying to have the path to MacVim as the Value of the EDITOR environment variable which is used by cscope: $ export EDITOR=/Applications/MacVim.app/Contents/MacOS/MacVim If I'm now trying to edit a file from within ctags, it won't work and throws this error message: $ MacVim...

how can my java code read OS environment variables?

hi, this may be a very simple problem, but I couldn't find an answer googleing and I'm in a rush - so I'd appreciate fast code examples. I have an environment variable on the OS i would like to read using java code. I've tried System.getProperty, but that only seems to work for the -D variables supplied directly for the JVM. how can m...

How can I modify my cygwin environment to use Strawberry Perl instead of the packaged Perl distribution?

I currently use Strawberry Perl as my primary Perl distribution. However, I have some applications that make Perl calls through cygwin. These generally fail because they are calling the version of Perl that was packaged with cygwin, and only looking in cygwin's lib folders. How can I modify my cygwin environment to call Strawberry Perl (...

How to specifiy common application data folder for log4net?

I want log4net to write log files (using RollingFileAppender) to a subfolder of the common application data folder (e.g. C:\Documents and Settings\All Users\Application Data\Company\Product\Logs). However, on Win XP, there is no environment variable that specifies this folder. We have %ALLUSERSPROFILE%, we have %APPDATA%, but there is no...

Accessing LocalApplicationData Equivalent in Delphi

Using Delphi, how do I access the equivalent of .NET's System.Environment.SpecialFolder.LocalApplicationData variable (which works on any version of Windows)? I assumed I could just do: dir := GetEnvironmentVariable('LOCALAPPDATA'); This works on Vista but XP doesn't seem to set that environment variable by default at least on my tes...

How do I make environment variable changes stick in Python?

From what I've read, any changes to the environment variables in a Python instance are only available within that instance, and disappear once the instance is closed. Is there any way to make them stick by committing them to the system? The reason I need to do this is because at the studio where I work, tools like Maya rely heavily on ...

environment path loading incorrectly in bash

I recently installed the Macports port of Ruby19 and it's changed my environment settings to point to opt/local in the first instance rather than usr/local where I have my standard 1.8.7 install. I've tried updating my ~/.profile by adding the usual export PATH etc. as the last line but to no avail. I have to run the .profile file each ...

Is there a way to read environment variables of other processes using Perl and in a Linux or Solaris environment?

In Perl, I need to read the environment of other processes. The script is running with root privileges. The script will be running in both Linux and Solaris. I would like a solution that's mostly platform agnostic, at least between Linux and Solaris. In Linux, examining the /env/<proc_id>/environ can get me the answer. I would like ...

Linux: where are environment variables stored?

If I type into a terminal, export DISPLAY=:0.0 ... where is the shell storing that environment variable? I'm using Ubuntu 8.10. I've looked in the files ~/.profile and /etc/profile and can find no trace of DISPLAY. ...

How do I find fully qualified hostname of my machine in C#?

Ex : I want something like abc.hyd.mycompany.com. My requirement is to parse this name and initialize appropriate service. use System.net; Dns.GetHostName() doesn't return fully qualified name it just gives "abc" ...

Why Powershell Environment PATH is different than the actual Environment PATH?

I'm having this weird situation : My user's and system's PATH variable is different than the PATH in powershell. When I do : PS C:\$env:path C:\Windows\System32\WindowsPowerShell\v1.0\;c:\oldpath However this is not correct, it looks like it stuck on some old PATH variable of my system, so none of the udpates I've done on it didn't...

How to add a default include path for gcc in linux?

I'd like gcc to include files from $HOME/include in addition to the usual include directories, but there doesn't seem to be an analogue to $LD_LIBRARY_PATH. I know I can just add the include directory at command line when compiling (or in the makefile), but I'd really like a universal approach here, as in the library case. ...

How to export and import environment variables in windows(e.g. XP)?

I found it is hard to keep my environment variables sync on different machines. I just want to export the settings from one computer and import to other ones. I think it should be possible, but don't know how to do it. Can anyone help me? Thanks. ...

Why doesn't the Java SDK installer set JAVA_HOME?

I always wondered why I have to manually set the JAVA_HOME environment variable after installing the Java SDK. JAVA_HOME=c:\Program Files\Java\jdk1.6.0_12 Visual Studio at least provides a batch file to set these kind of environment variables: call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" Does Java ha...

Inheriting aliases inside UNIX /usr/bin/script

The UNIX "/usr/bin/script" command will create a running transcript of your shell session (see "man script" for more info). However, when inside a script instance, it seems to forget the parent shell's env vars, aliases, etc. The following example demonstrates how the "ll" alias I define is ignored inside "script": zsh> mkdir temp zsh...

Visual Studio setup project, setting path but not seen in command window

I have a setup project in which I have a custom action that is adding the target folder to the path. Nothing special, works ok, adds it to the path. However if I then open a cmd window it's not available. If I psexec and try to directly run something that is in the folder it isn't found. I logged off the box and on again and it turne...

Where are environment variables stored in registry?

I need to access an environment variable remotely. To do this I think the best way is to read it from registry. Where are environment variables stored in registry? ...

Is it possible to set an environment variable at runtime from Java?

Is it possible to set an environment variable at runtime from a Java application? In Java 1.5 java.lang.System class there is the getenv() method, I would only need a setenv() method... Is it possible to modify the environment variables in the java process itself; not in the child process. Is it possible to achieve it through JNI? And ...