0

I have to execute a abc.bat file in a perl script.

If I run the batch file manually it asks for first param at first step. When I provide this at second step it will ask for second param..

I need to call this abc.bat file in a perl script

Something like..

system(‘abc.bat’); or exec()

But how to provide param run time..

The abc.bat batch file is a calling a java myclass which takes two params at runtime.

Below is the batch file

@echo off
setlocal
set classpath=.\my.jar;%classpath%
"%JAVA_HOME%"\bin\java com.myclass
@echo on

Please help .. Thank you.

2
  • any one could you please help me on this? Commented Jan 16, 2014 at 10:41
  • stackoverflow.com/questions/7426653/… Its better to pass at batch file level itself Commented Jan 16, 2014 at 12:17

1 Answer 1

1

Can you just use the %ENV variable to do everything directly in perl? Maybe:

$ENV{classpath} = ".\\my.jar;$ENV{classpath}";
system("$ENV{JAVA_HOME}\\bin\\java com.myclass");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.