Set Up Environment Variables Upon Launching Command Prompt
The Windows "Command Prompt" uses environmental variables that are set in "System Properties" -> "Environment Variables". Modifying them to your needs is easy enough if you have access. But on many computer systems, the "System Properties" are locked out of non-administrator users. One work around is to place all your environmental variable into a batch script and manually run it after starting the "Command Prompt". But in this article, I will demonstrate a quicker and more automated method.
Let's go with a made-up, but realistic example. Java is installed on your system. But it's not in your PATH variable. And CLASSPATH is also not defined. You want these two variables to be set every time you launch "Command Prmopt", but you don't have administrator rights. You also want "Command Prompt" to be in your Desktop directory when it launches. Ok. Easy enough. Here is the solution:
Put the above batch code into an executable batch script (say, "My Shell.cmd"). Now whenever you double-click the batch file, it sets up the environmental variables, changes to the desired directory, and starts the "Command Prompt".
Did your message disappear? Read the Forums FAQ.
Spam Control | * indicates required field
TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.
No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.
Messages, files, and images copyright by respective owners.
31 Users Online
Copyright © 1996 - 2019. All Rights Reserved.