Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 7 32-bit Program Files path in a Batch file Issue

I have batch file that I am inheriting and I cannot get to work in a 64bit Windows 7 environment. The batch file makes a call to a java script, and passes two variables in it. The old on looked like this:

 C:\Progra~1\salesf~1.com\ApexDa~2.0\bin\process.bat     C:\Progra~1\*PATH*     *VARIABLE*

This was run onm 32bit XP which has just the one program files. I have tried every way I can think of to change the being of the the path to Program fiels x86. I have tried SET PATH, SET ExecPath, %ProgrmaFiles(x86), but they all return cannot find the path specified. I am sure the answer is easy, and I know there is a much beeter way to do this, and it will be changed, but for the moment, I need this to work. Any help, much appreciated.

like image 441
KCavon Avatar asked Jan 25 '11 17:01

KCavon


People also ask

How do I pass Program Files x86 in CMD?

While in the command prompt type "cd\", then enter. From there type "cd\program" then hit the tab button until you see "c:\program files (x86)", then hit enter.

How do I find program files in command prompt?

Type "start [filename.exe]" into Command Prompt, replacing "filename" with the name of your selected file. Replace "[filename.exe]" with your program's name. This allows you to run your program from the file path.

How do I remove spaces from program files?

Run Disk Cleanup Its purpose is to remove old, temporary, and other unnecessary files taking up space on your PC. If you've used your computer for a while and haven't ever run it, you could reclaim several gigabytes of space. To open it, just search for Disk Cleanup in the Start Menu.


2 Answers

If you type

 dir /x c:\

then this shows the directory listing in the 8.3 format. Program Files expands to PROGRA~1 and Program Files (x86) expands to PROGRA~2. So I think you'll need to change the script to use PROGRA~2

EDIT: I agree with Mark that this isn't ideal -- it depends how much you are able to change of the legacy scripts. On a Win7 machine you should be able to use %ProgramFiles% and %ProgramFiles(x86)% (note the trailing '%').

like image 186
the_mandrill Avatar answered Oct 12 '22 14:10

the_mandrill


export JAVA_HOME=/cygdrive/c/Progra~1/java/jdk1.7.0_40/

This worked for me.

like image 21
Smitha Avatar answered Oct 12 '22 12:10

Smitha