By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,847 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,847 IT Pros & Developers. It's quick & easy.

running windows batch program in perl

P: 89
hi friends,

need help from you....
i have a Windows batch program..
i need to run it from a perl script.....

regards
rohit
Mar 28 '08 #1
Share this Question
Share on Google+
6 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
hi friends,

need help from you....
i have a Windows batch program..
i need to run it from a perl script.....

regards
rohit

Sorry, I don't know the answer but hopefully one of our experts will be able to assist you.

My appologies for the delay in getting an answer to your question.

Regards,

Jeff
Apr 17 '08 #2

nithinpes
Expert 100+
P: 410
hi friends,

need help from you....
i have a Windows batch program..
i need to run it from a perl script.....

regards
rohit
You can use any of the following ways:
Expand|Select|Wrap|Line Numbers
  1. system("C:\\mybatch.bat");
  2.  
OR

Expand|Select|Wrap|Line Numbers
  1. system("start C:\\mybatch.bat"); ## this will open a new command window
  2.  
OR

Expand|Select|Wrap|Line Numbers
  1. exec("C:\\mybatch.bat");
  2.  
OR

Expand|Select|Wrap|Line Numbers
  1. `C:\\mybatch.bat`;  # using backticks(reverse quotes)
  2.  
If you want to capture the output, assign it to a variable. For ex:
Expand|Select|Wrap|Line Numbers
  1. @res=`C:\\mybatch.bat`; 
  2.  
Apr 21 '08 #3

P: 89
Sorry, I don't know the answer but hopefully one of our experts will be able to assist you.

My appologies for the delay in getting an answer to your question.

Regards,

Jeff
no issue Jeff.
i have got the answer..
Apr 24 '08 #4

P: 89
You can use any of the following ways:
Expand|Select|Wrap|Line Numbers
  1. system("C:\\mybatch.bat");
  2.  
OR

Expand|Select|Wrap|Line Numbers
  1. system("start C:\\mybatch.bat"); ## this will open a new command window
  2.  
OR

Expand|Select|Wrap|Line Numbers
  1. exec("C:\\mybatch.bat");
  2.  
OR

Expand|Select|Wrap|Line Numbers
  1. `C:\\mybatch.bat`;  # using backticks(reverse quotes)
  2.  
If you want to capture the output, assign it to a variable. For ex:
Expand|Select|Wrap|Line Numbers
  1. @res=`C:\\mybatch.bat`; 
  2.  

thanks Nitin. I know it works in unix with perl.
but whether it work in windows with active perl, i don't know.
this question was asked to me who works in windows platforn.
i told how i do it in unix platform to run a shell script within perl.
Apr 24 '08 #5

nithinpes
Expert 100+
P: 410
thanks Nitin. I know it works in unix with perl.
but whether it work in windows with active perl, i don't know.
this question was asked to me who works in windows platforn.
i told how i do it in unix platform to run a shell script within perl.
It works very well in Windows with Activestate perl. :)
Apr 24 '08 #6

P: 89
It works very well in Windows with Activestate perl. :)
thats great. thanks.
Apr 25 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.