I believe that if you do not put some sort of quote marks around the contents of the parentheses for the system command, it assumes you want to parse the entry. In that case, you would have undesirable results.
Also, you don't ~have~ to have a variable name in there in less you just want to.
Try this:
$PgmReturn = system('cd /D C:\install');
$PgmReturn = system('setp.exe');
or this:
$PgmReturn = system(cd /D C:\\install);
$PgmReturn = system('setp.exe');
Also, you could use the perl command, chdir(), instead of a system call to "cd".
That would look like this (I think):
chdir('C:\install') or die "I can't find that directory: $!";
system('setp.exe');
Or, you could just do this:
system('C:\install\setp.exe');
As always, There's More Than One Way To Do It (tm).
-Jason
-----Original Message-----
From: Kyle Payne [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 27, 2001 3: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
