Sign in to follow this  
Followers 0
IndyUK

Running a JAR file

4 posts in this topic

Hi All,

I'm trying to run a batch file which calls a jar file. It also sets up environment variables. When I run it by double clicking it works. However if I call it from AutoIt using Run I get an error (as expected).

Here's the content of the batch file...

set USER_CLASSES=%USER_BASE_CLASSES%;%CLASS_DIR%\UserApplication.jar;%CLASS_DIR%\UserApplication_Stubs.jar
set CLASS_PATH="%USER_CLASSES%;%USER_LIBS%"
set PATH="%JAVA_DIR%\bin;%INSTALL_DIR%\bin"

%DRIVE_DIR%
cd %LOG_DIR%

start %JAVAW_EXE% -Djava.security.policy=%POLICY% -Djava.library.path="%JAVA_DIR%\bin;%INSTALL_DIR%\bin" -Dshowurl=1 -cp %CLASS_PATH% %PROG_NAME% %CONFIG_URL%
exit

How do I run the above?

Thanks

Share this post


Link to post
Share on other sites



Can you post you code?? Try running it like this ?

RunWait(@ComSpec & " /C " & $pathToBAT, @ScriptDir)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Can you post you code?? Try running it like this ?

RunWait(@ComSpec & " /C " & $pathToBAT, @ScriptDir)
I'm basically running the following line..

ShellExecute("C:\Lagan\Frontline\TestV6\userstart.bat")
Edited by IndyUK

Share this post


Link to post
Share on other sites

I'm basically running the following line..

ShellExecute("C:\Lagan\Frontline\TestV6\userstart.bat")
Throw a pause in your Batch file to make sure AutoIt isn't passing some sort of parameter...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0