# Solved: Batch File Output help



## Maxamuz (Sep 22, 2010)

I am trying to write a batch file that will tell me what version of Java the user has installed and I would like to have it saved as a .txt file.

using java -fullversion will get me the version and I know > / >> makes an output of a .txt file but its not showing anything in the file, only creating it.

Is there a way to make a batch file that tells me what version of Java the user is running?


----------



## Squashman (Apr 4, 2003)

I think you will have to pull it straight from the registry.
http://www.rgagnon.com/javadetails/java-0642.html


----------



## TheOutcaste (Aug 8, 2007)

For some reason it's outputting the info to STDERR
Use this:
java -FullVersion 2>JavaVer.txt


----------



## Maxamuz (Sep 22, 2010)

How do I get it to save to a .txt file tho to a certain location?


----------



## Squashman (Apr 4, 2003)

Just add the path in front of the file name.


----------



## Maxamuz (Sep 22, 2010)

I have used the java -fullversion 2>javaver.txt but it won't generate the file in a batch, only in a command prompt.


----------



## Maxamuz (Sep 22, 2010)

what does the " :: " in the file mean?


----------



## TheOutcaste (Aug 8, 2007)

Works fine for me in a batch file in both XP and Win 7. Keep in mind that the file will be created in the current directory unless you specify a full path. Paths with spaces must be quoted as well.
Make sure you have a space before the 2 as well

: is used to start a comment line, similar to the REM command. Since labels also start with :, it's common to use :: to indicate it's a comment and not a label. It's just being used for spacing in that file


----------



## Squashman (Apr 4, 2003)

Maxamuz said:


> I have used the java -fullversion 2>javaver.txt but it won't generate the file in a batch, only in a command prompt.


Post your batch file here. Please surround the code in BB CODE tags.


----------

