Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Environment Variables

23 Jan 2015   #1
rosphite1

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 
Environment Variables

Hi
I set up a User defined Enviro. Var. called GomFolder to be C:\Users|Damo\MyDocuments\NinjaTrader 7
See the attached clip
2015-01-23_1242 - Judge101010's library

My understanding is that this should set up a folder called GomFolder in the NinjaTrader 7 folder.
Is this correct?

If not; should I set up a folder in NinjaTrader 7 called GomFolder and then go into the Environment Variables and set up a new GomFolder Enviro. Var. as C:\Users|Damo\MyDocuments\NinjaTrader 7\GomFolder?

Sorry if the question is remedial - I've done the first and can't find the GomFOlder anywhere after hours of looking so now i'm thinking my understanding is completely inaccurate and the Enviro. Var. settings only allow you to assign a name to something like in my case a filepath??

Any help would be most appreciated
Thanks
Damo


My System SpecsSystem Spec
.
23 Jan 2015   #2
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Dear Damo,

Everything you know about Environment Variables, please, erase from memory now.

Okay. Now, let me re-word your OP:
Quote   Quote: Originally Posted by rosphite1
What are Environment Variables?
I'm glad you asked, Damo, because I was just about to explain what they are.


Environment Variables are essentially variables that store information about an Operating Environment, such as the computer name, the systems root directory, your username, temporary folders etc. These environment variables consist of key|value pairs, where both key and value entries are arbitrary strings. Many operation systems have their different implementations of them and set and use them differently. In Windows, environment variables are created by the OS at boot, and more so are created and some changes as the user progresses into their logged in session.

A common environment variable that is native to Windows and Unix systems, is the Path variable. This variable holds a list of folder hierarchies, separated by a semicolon, that a shell would use to search for a command.

Applications make use of these environment variables too. They can create their own temporary environment variables that exist until the application's process exits, and some applications rarely create persistent environment variables (which is what you've managed to do manually, Damo) that are a more permanent way of storing an environment variable i.e. writing the variable to the master environment: the registry.

Environment variables are a way of passing configuration information from process to process (a process is just an instance of an executable). Each process has an Environment; an area in memory to store these environment variables. When a process starts a process (this new process is know as a child-process), the child-process inherits a copy of it's parent process' environment. A good example of this in action is How To Play Minecraft Off Your USB Drive.

The Minecraft application queries the AppData environment variable in order to locate the user's AppData folder. That's how it knows where to save its game data. So by taking advantage of both the fact that the application uses this environment variable, and the fact that child-processes inherit environments; the tutorial in the Minecraft forums link above directs the user to create a Windows batch file which will change the AppData environment variable before launching the Minecraft executable. This new Minecraft process is a child-process of an instance of cmd.exe which is the command processor for batch files.


A standard user should never need to concern themselves with environment variables in any way.
Quote   Quote: Originally Posted by rosphite1 View Post
If not; should I set up a folder in NinjaTrader 7 called GomFolder and then go into the Environment Variables and set up a new GomFolder Enviro. Var. as C:\Users|Damo\MyDocuments\NinjaTrader 7\GomFolder?
I haven't the slightest clue what you are trying to do, Damo, but I would refrain from setting up a persistent environment variable that isn't going to do a thing.
My System SpecsSystem Spec
28 Jan 2015   #3
rosphite1

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Thank you Pyprohly
That's a lot of information - I appreciate you taking the time to go into the detail. I've read it a few times and I think I know what to do.

To answer your question: I have an application running on the PC. My understanding is that the app will write data files to a folder called GomFolder, at the end of each day.

If my understanding is correct from your post I need to create a new folder somewhere called GomFolder. Then I create an Enviro. Var. called GomFolder and set it's value to the path of where I put GomFolder. Then the app (NinjaTrader) will put the data files in GomFolder?

Would that be along the right lines......?
My System SpecsSystem Spec
.

29 Jan 2015   #4
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by rosphite1 View Post
My understanding is that the app will write data files to a folder called GomFolder, at the end of each day.
My Google-ing of this "NinjaTrader" application tells me similar. I think you meant to say, though, "the app will write its data files to the value of the GomFolder environment variable". As "GomFolder" will simply be the variable name, that in this case will hold a path.

So if the NinjaTrader application detects an environment variable named "GomFolder" (doubt the caps really matter), it will read the value of this "GomFolder" variable and write to the path location of the value that the variable represents; instead of it's default location (being "C:\username\Documents"?).

It's my guess. But I'm pretty sure this is the nature of the application.

Once you've created the environment variable, fire up NinjaTrader. There should not be a need to manually create the same path of the value you've decided to set "GomFolder" to. The application should create that for you.


To create an environment variable, go to:
Control Panel > System and Security > System > Advanced system settings > Environment Variables
OR
WinKey+Pause|Break > Advanced system settings > Environment Variables

It does not matter if you create the environment variable in "User variables" or "System variables", but note that if you decide to create a variable in "System variables", other users on the local machine will be able to see and use this variable. On the other hand, variables in "User variables" are private and only accessible to that user account.


An extra thing I ought to mention: to expand an environment variable you'd simply surround percent signs around the variable name. Type "%userprofile%" into the Windows Explorer bar, and notice it takes you to your user's home directory, because "userprofile", as you'll see, is an environment variable that expands to the path of your user directory. And once, Damo, you've set up "GomFolder" to be some path, type the variable name, surrounded by percents, into the Explorer bar. And watch as it takes you to the location of the value you've set the variable to.
My System SpecsSystem Spec
Reply

 Environment Variables




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Windows 7 Environment Variables List
Environment Variable Path %ALLUSERSPROFILE% C:\ProgramData %APPDATA% C:\Users\{username}\AppData\Roaming %COMMONPROGRAMFILES% C:\Program Files\Common Files %COMMONPROGRAMFILES(x86)% C:\Program...
Performance & Maintenance
Windows 7 Environment variables
Is there an Environment variable that can tell me where the Documents folder is located? Typically, the Documents folder is located in C:\Users\username\Documents. I am creating a batch file to copy 1 file from a remote location (another computer in the network) to the Documents folder. Since...
General Discussion
What are Environment Variables in Computer?
Hey, Can anyone explain are environment variables are within the Advanced System Settings of Computer? I've had to create a new environment variable for a Java complier, and I was just wondering what exactly are environment variables are and why are they used? Thanks, Harry P.S I've...
General Discussion
Edit Environment Variables via command line
I know how to udpate my environment variables using the stupidly slow to navigate windows. This is pointlessly slow IMHO. How do i type a command, ONCE, that will update/add an environment variable that does not need to be retyped every time i open a new CLI session. The SET command seems...
Performance & Maintenance
Environment variables to point to the Java compiler
Hi everyone I have recently installed the Java Development Kit 6 in my Windows 7 Ultimate 32 bit installation but not been able to set the path to the javac compiler in the Environment Variables. What I have done so far is: Opened the Environment Variables dialog obx Created a new PATH...
General Discussion
Java, Windows 7 & Environment Variables
I have installed Java in Program Files (x86) > Java > jre > bin In Environment Variables, I accidentally deleted the default PATH variable. This is what I currently have in the PATH variable: Please can someone tell me what the default PATH was? I will add this in front of the Java path. ...
Software


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 21:11.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App