Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-19-2008, 04:59 PM
Member
 
Join Date: Jun 2008
Posts: 14
jmHoekst is on a distinguished road
quick easy question
i am using Runtime to execute a VBScript and it works fine with this syntax:
Runtime.getRuntime().exec("wscript \"C:/Path/script.vbs\"");


however, when i change the path to be a network, it gives me an error:
Runtime.getRuntime().exec("wscript \"//server/Path/script.vbs\"");
Error: Unknown option "//server/Path/script.vbs" specified

i know for a fact that i have access to the server, as i reference it in other places in my program. it is the vbscript that is throwing the error, not Java, but i don't know why that would be. my vbscript just finds the memory usage of a specific process and writes that number to a txt file.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-19-2008, 05:28 PM
serjant's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Ukraine,Zaporozhye
Posts: 338
serjant is on a distinguished road
Send a message via ICQ to serjant Send a message via Skype™ to serjant
I think that the path is not recognized in your case,try to create package in Java project,insert there your VBScript(for example the name of the package is "vbnet"),and for instance your class name where you wanna execute the vbscript is Exec,so you should specify the follofing:

Code:
Runtime.getRuntime().exec("wscript \"+"""+Exec.class.getRecourse("/vbnet/script.vbs")+""");
Then your script will be found and will be launched with Runtime
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Noob question- easy mattonitto New To Java 7 06-13-2008 02:26 AM
Quick question about sorting nbd223 New To Java 10 04-28-2008 11:11 AM
Quick Java question/help Zedy New To Java 6 04-22-2008 05:40 AM
Quick Stupid Question bluekswing New To Java 7 01-08-2008 08:35 PM
Easy question JavaNoob New To Java 10 08-04-2007 12:28 AM


All times are GMT +3. The time now is 12:08 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org