[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

including multiword directory names in path specifications, environment variable settings, etc.

Posted on 2012-09-01
3
Medium Priority
?
599 Views
Last Modified: 2012-09-02
EE Community,

I have some scripts that need to obtain the value of the Environment Variable 'JAVA_HOME'.  The fact that the value of this variable on my machine includes "C:\Program Files" appears to cause problems for the scripts I'm trying to run.  So I see error messages with the complaint that the file location "C:\Program" cannot be found.  I've tried surrounding the value of 'JAVA_HOME' with quotation marks in the listing for this variable in the Windows Environment Variables, but this did not resolve the problem.  This seems like it must be an old, classic Windows system complication (having multiword names for important system directories like 'Program Files'), so I'm thinking there must be ways to deal with this problem that others have come up with.  If anyone here has any suggestions for this, please let me know.

Thanks.

Andy
0
Comment
Question by:aedolbey
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
5teveo earned 1000 total points
ID: 38358159
Read this before...

try it.

You can usually fix it by turning on delayed expansion and use variables with !var! instead of %var%

What version of windows are you using?

Could be escape sequences in your path command.

Does you Set command produce the correct results?

Recreate System variable to include quotes at that level not in your re-use of "java Home"
0
 

Author Comment

by:aedolbey
ID: 38358174
Sorry, I should've included some details about the system I'm using in my post with the question.  I'm running the scripts I was talking about on Win7 Enterprise.  My own preference would be to use Linux of some flavor, but OS choice is a decision of the company I work for.  In general, I use Cygwin as a substitute as much as I can.  For running the scripts I mentioned in the question I posted here, I use Cygwin first, then back off to a Win 7 cmd prompt if there were problems, just to be sure it's something with Cygwin causing the problem.  But I had the same problem with both options.

Does the OS setting I describe here change the advice you offered?
0
 

Author Closing Comment

by:aedolbey
ID: 38359650
Recreated System variable to include quotes.  This was probably the problem from the start.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Assume you have an outside contractor who comes in seasonally or once a week to do some work in your office, but you only want to give him access to the programs and files he needs and keep all other documents and programs private. Can you do this o…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question