A B C wrote:
Greetings,
Does anyone know how to get perl to run windows
commands like dir /b. Specifically, perl doesn't
accept any type of argument switches. I've tried
system(), exec() and backticks in my script.
However, If I remove the switch, for example:
system(dir). This works
Hi,
I'm using ActiveState v5.8.4 on Windows XP Home03.
Here is the entire script...
print `dir /s`;
print \n-\n;
system('dir /b');
print \n-\n;
exec(dir /w);
print \n-\n;
===
Here is the result after executing...
C:\~pperl test.pl
dir: /s: No such file or directory
I'm using ActiveState v5.8.4 on Windows XP Home03.
Here is the entire script...
print `dir /s`;
print \n-\n;
system('dir /b');
print \n-\n;
exec(dir /w);
print \n-\n;
Since dir is a built-in, you should do this:
use strict;
print qx!cmd /c dir /s!;
print \n-\n;
Luke, Thanks! Your code works, you are a fantastic
help. I've been surfing (and surfing and surfing)
google for hours trying to find the answer. Your code
works and now my testing can proceed :-) -Mark
--- Bakken, Luke [EMAIL PROTECTED] wrote:
I'm using ActiveState v5.8.4 on Windows XP