Re: dos batch files, java and the universe

  • From: "Martin Slack" <m.g.slack@xxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 12 Jul 2010 09:28:35 +0100

Hi Laura,

I can't help with your java problems, but the batch file should just be called using its name (with or without the .bat) extension, and any variables set within the file should then be visible from the command line. Mind you, I mostly operate where the pwd contains the batch file of interest.

 So if you say:

prompt> set p

that should print out your current path (and any other environment variable that starts with the letter p). Then if you have a batch file called le.bat in the current directory with the line:

set path=something;%path%

and call it using: le (or le.bat), then I would expect that if you ran the set p command again from the command line, the modified value of the path would be shown.

I would, however, view your quoting of the right-hand side of your set statement with grave suspicion. DOS is incredibly picky about quoting. I would feel much happier quoting only the additional path, perhaps like this:

set java_home="c:\program files\java\jdk1.6.0_20\bin"
set path=%java_home%;%path%

I take it you know how to call the rudimentary DOS help system from the command line with:

help | more

 for a list of some commands, then command /? for more detailed info?

 hth

Martin


----- Original Message ----- From: "qubit" <lauraeaves@xxxxxxxxx>
To: "bprogramming" <programmingblind@xxxxxxxxxxxxx>
Sent: Monday, July 12, 2010 3:54 AM
Subject: dos batch files, java and the universe


From the recent mail on this list I have gotten the impression that dos
batch files run differently on different versions of windows.
Does this apply to basic syntax and semantics, or is the difference only in
advanced commands?

I am trying to write a batch file and am finding dos just similar enough to
bash to look familiar, but just different enough to trip me up.
What I need is a command to put me in an environment where my java commands
will work, as well as my own java programs.
I have installed the JDK in
java_home="c:\program files\java\jdk1.6.0_20"
Obviously I need path reset:
set path="%java_home%\bin;%path%"
I also need to set something else like class_path -- if I am remembering
right.
But I have been unable to get this to work.
If anyone has comments, please fill in the blanks.
(But no "blankety blanks" please*smile*)

Oh, and how do I call a batch file so it is executed within the parent dos
shell? that is, the variables set in the batch file keeps its value after
the batch file exits.
Thx.
--le

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: