Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get java path with visual basic script?

Status
Not open for further replies.

grofaty

IS-IT--Management
Jan 16, 2003
370
SI
Hi,

I would like to get default java path. Is it posible to get it with some visual basic script?

Thanks,
Grofaty
 
Post the location in the registry and I can provide a script that reads it.

I hope you find this post helpful.

Regards,

Mark
 
markdmac,
that is the problem, because I have searched the reqistry but I can't find the path. There is no path exactly like the java code returns, but are plenty of somekind similar to what java code returns.

Java code is:
System.getProperty("java.home")

Thanks,
Grofaty
 
Sorry I don't have java installed to be able to play with it.

I hope you find this post helpful.

Regards,

Mark
 
You might want to try posting this question in the vbscript forum.

I hope you find this post helpful.

Regards,

Mark
 
Try this.
Code:
s=createobject("wscript.shell").environment.item("java_home")
wscript.echo s
 
tsuji,
it returs empty string. Just msgbox without text was opened.
 
>it returs empty string
So you don't have java_home set.
 
tsuji,
that is not true! With java program I can see the result:
C:\Program Files\JavaSoft\JRE\1.3.0_02

But your vb script returns empty string.
 
>So you don't have java_home set.
I meant what I said. The rest you have to figure out yourself. java_home is usually set when you install jdk. So we may be talking about different thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top