No announcement yet.

Converting simple Batch file to VBS script

  • Filter
  • Time
  • Show
Clear All
new posts

  • Converting simple Batch file to VBS script

    I need to convert a .bat file into .vbs script because other batch files I tried run errors on XP pro. I get the error: Windows cannot find '../jre/bin/javaw' when I run the following file:

    1 cd ..
    3 start ../jre/bin/javaw -classpath ./plugins/com.swimap.omc.common/com.swimap.omc.common.jar; com.swimap.omc.common.main.AppLauncher Client"client\bin\omcClient.bat"
    4 exit

    I put numbering in front to indicate the lines.

    Any help will be welcome. the administrator: I hope not this is posted twice, because my system went offline when I pressed submit button and had to retype all.

  • #2
    Re: Converting simple Batch file to VBS script

    That's not a problem with BAT versus VBS, you likely just aren't starting in the right folder when you run it. As it stands:


    Has a couple of issues. First, the forward slashes need to be back slashes on a Windows system, that could be causing a problem.

    Also, that command needs to find the javaw.exe progam file in the jre/bin folder of the parent of the current folder. A better approach would be to locate where the javaw.exe program is on your system and include the full path on the command line. Or add the fully qualified BIB folder to your PATH.

    I suspect you might need something like this, but you'll need to check where your installation of the JRE put these files:

    "c:\program files\java\jre\bin\javaw"

    From billphew at EE.
    Last edited by Managor; 8th February 2011, 18:29.
    "To err is human but to really **** things up requires a computer user..."

    "The path to enlightenment is /user/bin/enlightenment"

    A+ CE


    • #3
      Re: Converting simple Batch file to VBS script

      Converting bat into VBS or anything else isn't going to help you. The problem is that you are trying to launch Java from relative a path. Your current working directory (or drive) is such that Java cannot be found by stepping twice towards the root.

      Find the Java binary and jar files. Change the commands to use absolute paths, that is, paths like "C:\Program Files\Sum\Java\bin"... and the script should work.