jvieira
asked on
Running a program in WinNT
Hello,
I have perl installed on WinBT 4.0. I am trying to setup a perl script that will execute a VB executable and than sleep for x amount of time and repeat. I have everything set except for the part of executing the vb program. Does anyone remember how to get perl to run a program. I know it was something simple I just can't remember, I thought it was 'system()' but I was wrong.
Thanks,
Joe
I have perl installed on WinBT 4.0. I am trying to setup a perl script that will execute a VB executable and than sleep for x amount of time and repeat. I have everything set except for the part of executing the vb program. Does anyone remember how to get perl to run a program. I know it was something simple I just can't remember, I thought it was 'system()' but I was wrong.
Thanks,
Joe
ASKER
This is what I have:
$status = 1;
while ($status) {
$v = `D:\Stuff\Project1\Project 1.exe`;
print $v,"\n";
sleep 10;
}
minus the parts that change the value of $status. I get the following error:
The name specified is not recognized as an internal or external command, operable program or batch file
What am I missing?
Thanks,
Joe
$status = 1;
while ($status) {
$v = `D:\Stuff\Project1\Project
print $v,"\n";
sleep 10;
}
minus the parts that change the value of $status. I get the following error:
The name specified is not recognized as an internal or external command, operable program or batch file
What am I missing?
Thanks,
Joe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I beleive the problem with the application not being recognized is that you were using the windows "\" in your file name, which Perl tries to interpret at meta sequences.
Try the following:
$status = 1;
while ($status)
{
system("D:/Stuff/Project1/ Project1.e xe");
sleep 10;
}
or, if you need the return value from the application:
$status = 1;
while ($status)
{
$retVal=`D:/Stuff/Project1 /Project1. exe`;
print "$retval\n";
sleep 10;
}
Whitty
Try the following:
$status = 1;
while ($status)
{
system("D:/Stuff/Project1/
sleep 10;
}
or, if you need the return value from the application:
$status = 1;
while ($status)
{
$retVal=`D:/Stuff/Project1
print "$retval\n";
sleep 10;
}
Whitty
ASKER
Whitty,
maneshr answered the question first.
Joe
maneshr answered the question first.
Joe
ASKER
I'm always making stupid mistakes like that.
Thanks,
Joe
Thanks,
Joe
i guess at some point of time, we all make stupid mistakes.
glad to be of help :-)
glad to be of help :-)
Eg.
$v=`dir`;
print $v,"\n";