Results 1 to 2 of 2
Thread: quick easy question
- 06-19-2008, 02:59 PM #1
Member
- Join Date
- Jun 2008
- Posts
- 14
- Rep Power
- 0
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.
- 06-19-2008, 03:28 PM #2
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:
Then your script will be found and will be launched with RuntimeJava Code:Runtime.getRuntime().exec("wscript \"+"""+Exec.class.getRecourse("/vbnet/script.vbs")+""");
Similar Threads
-
Noob question- easy
By mattonitto in forum New To JavaReplies: 7Last Post: 06-13-2008, 12:26 AM -
Quick question about sorting
By nbd223 in forum New To JavaReplies: 10Last Post: 04-28-2008, 09:11 AM -
Quick Java question/help
By Zedy in forum New To JavaReplies: 6Last Post: 04-22-2008, 03:40 AM -
Quick Stupid Question
By bluekswing in forum New To JavaReplies: 7Last Post: 01-08-2008, 06:35 PM -
Easy question
By JavaNoob in forum New To JavaReplies: 10Last Post: 08-03-2007, 10:28 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks