Title: RE: How can I get Perl to work like a bat file.

In addition to the replies you've already received ... you can use CMD's command separator '&&':

$PgmReturn = system('cd /D C:\\install && setp.exe');

Using unquoted strings is a bad habit that will eventually cause you grief.  Backslashes within quoted strings have to be doubled.

Gary

-----Original Message-----
From: Kyle Payne [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 27, 2001 2:34 PM
To: Perl Win32 Admin (E-mail); Perl User (E-mail)
Subject: How can I get Perl to work like a bat file.


In a bat file I can have the following:
cd /D C:\install
setup.exe

This will change directory into C:\install and then run setup.exe.

If I put this in a perl program

$PgmReturn = system(cd /D C:\install);
$PgmReturn = system(setp.exe);

Then it does a CD but that apears to be seperate from the next command.  How
do I get it all to work together like the .bat file would.




Kyle Payne
Berbee
4000 West Spencer Street
Appleton, WI 54914-4015
[EMAIL PROTECTED]
Office: 920.996.3107
Fax: 920.997.9719
Pager: 920.586.3014
Cell: 920.450.0413

Berbee...putting the E in business

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to