Results 1 to 2 of 2
  1. #1
    jmHoekst is offline Member
    Join Date
    Jun 2008
    Posts
    14
    Rep Power
    0

    Default 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.

  2. #2
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    7

    Default

    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:

    Java Code:
    Runtime.getRuntime().exec("wscript \"+"""+Exec.class.getRecourse("/vbnet/script.vbs")+""");
    Then your script will be found and will be launched with Runtime

Similar Threads

  1. Noob question- easy
    By mattonitto in forum New To Java
    Replies: 7
    Last Post: 06-13-2008, 12:26 AM
  2. Quick question about sorting
    By nbd223 in forum New To Java
    Replies: 10
    Last Post: 04-28-2008, 09:11 AM
  3. Quick Java question/help
    By Zedy in forum New To Java
    Replies: 6
    Last Post: 04-22-2008, 03:40 AM
  4. Quick Stupid Question
    By bluekswing in forum New To Java
    Replies: 7
    Last Post: 01-08-2008, 06:35 PM
  5. Easy question
    By JavaNoob in forum New To Java
    Replies: 10
    Last Post: 08-03-2007, 10:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •