system command on Win98

M

Mike Flannigan

On Win2000, my scripts that execute another program
with system (or exec) work fine. But when I try the
same scripts on Win98, it gives an error "bad command
or file name" when it hits the system (or exec) command.

I see that others have reported similar problems with
the system command on Win32:
http://perlmonks.thepen.com/104680.html
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/9986?help-en

but I don't see an obvious solution to the problem.

Anybody on this list using Perl on Win98 and know how
to fix this problem? I also see that the shell on Win98
sucks. I need to replace that also.

The command I am using is:
system 'lltost.fch';


Mike Flannigan
 
A

A. Sinan Unur

On Win2000, my scripts that execute another program
with system (or exec) work fine. But when I try the
same scripts on Win98, it gives an error "bad command
or file name" when it hits the system (or exec) command.

I see that others have reported similar problems with
the system command on Win32:
http://perlmonks.thepen.com/104680.html

What are you talking about? That discussion is entitled "How do I fork a
process under Win 32?"

You mentioned system or exec. The two do different things. Which one is it?

Post a short but complete script others can run. Describe what happens and
what you thought would happen. Read the posting guidelines for this group
for more information on how to post here.
Anybody on this list

This is not a list.
using Perl on Win98 and know how to fix this problem?

I do have a Win 98 handy but I have not seen anything here that would
prompt me to turn it on and try and diagnose a problem.
I also see that the shell on Win98 sucks.

It works.
The command I am using is:
system 'lltost.fch';

What on God's Orange Titan is lltost.fch??? Does that file exist? Is that
really an executable? If not, does the associated application exist? If it
does, have you tried

system 'start lltost.fch';

If you have done these things, why are you hiding the information? If
haven't why not?

Sinan
 
S

Sisyphus

Mike said:
On Win2000, my scripts that execute another program
with system (or exec) work fine. But when I try the
same scripts on Win98, it gives an error "bad command
or file name" when it hits the system (or exec) command.

That means that the shell doesn't understand the system command. You
have to set things up so that the shell does understand the command -
which, for a start, would involve making sure that the file in question
exists in the system path on the 98 box. You'll also need to add the
'.fch' extension to the pathext system variable. (I would have to do
precisely the same on my 2k box if I wanted to run that system command.)

Cheers,
Rob
 
M

Mike Flannigan

A. Sinan Unur said:
What are you talking about? That discussion is entitled "How do I fork a
process under Win 32?"

You mentioned system or exec. The two do different things. Which one is it?

My problem is with system, which I read somewhere creates
a fork to execute the file, but maybe I am wrong about that.

Post a short but complete script others can run.

My script is:
use strict;
use warnings;

system 'lltost.fch';

__END__

But I don't expect others can run that as-is.

I guess a better generic test would be:
system 'C:/Windows/explorer.exe';
which also does not work for me (does not fire up explorer),
but at least it does not give a warning or error. It just
runs, terminates, and does not appear to do anything
useful.

Describe what happens and
what you thought would happen. Read the posting guidelines for this group
for more information on how to post here.

I did describe what happened. I expected the program
to run as it does on my Win2000 machine.

It works.

Yeah, but it doesn't seem to keep a historical record of
typed lines that can be recalled with the up arrow.
That's why I say it sucks. I need to see if I can
find another one that I like better.

What on God's Orange Titan is lltost.fch??? Does that file exist? Is that
really an executable? If not, does the associated application exist? If it
does, have you tried

Yes, the file is in the same directory as the perl script
that I am running. It is associated with an application
and runs fine if you double click on it.

It is a programing language that I create with the
Perl script and then execute immediately.

system 'start lltost.fch';

If you have done these things, why are you hiding the information? If
haven't why not?

I'm not sure I understand you here, but I did not
previously try the 'start lltost.fch'. I just tried it
now for the first time and it worked! So thanks.

Yes, I should have figured that out from the
links I posted, but I tried about a hundred other
things and did not try that one until now.



Mike Flannigan
 
M

Mike Flannigan

Sisyphus said:
That means that the shell doesn't understand the system command. You
have to set things up so that the shell does understand the command -
which, for a start, would involve making sure that the file in question
exists in the system path on the 98 box. You'll also need to add the
'.fch' extension to the pathext system variable. (I would have to do
precisely the same on my 2k box if I wanted to run that system command.)

Cheers,
Rob

Thanks for the reply.

I put the directory in the path and that did not solve
the problem. No change. I'm kinda glad it didn't
solve the problem, because that would have confused
me, and proved that I don't understand Path.

system 'start lltost.fch' does work, thanks to Sinan pointing
that out. Not sure why 98 needs that 'start' in there, but
apparently it does.

Thanks again,


Mike
 
A

A. Sinan Unur

:

Yeah, but it doesn't seem to keep a historical record of
typed lines that can be recalled with the up arrow.

Oh, well, you should familiarize yourself with the system you are
working on. Try typing doskey on the command line. And, please do not
ask follow up questions regarding this.
Yes, the file is in the same directory as the perl script
that I am running. It is associated with an application
and runs fine if you double click on it.

The standard way to open such files from the command line on Windows
systems (all of them) is to use start.

I suspect .fch appears in your PATHEXT environment variable on the Win2K
system.
I'm not sure I understand you here, but I did not
previously try the 'start lltost.fch'. I just tried it
now for the first time and it worked! So thanks.

You asked an operating system question disguised as a Perl question. You
created further confusion and work for the reader by including
references to two utterly irrelevant articles on forking and ruby.
Please do not consider this an accomplishment and try and avoid it in
the future.

I repeat, you should familiarize yourself with the platform you are
working on.

Sinan.
 
A

A. Sinan Unur

Thanks for the reply.

Odd, it does not look like you read it.
I put the directory in the path and that did not solve
the problem. No change. I'm kinda glad it didn't
solve the problem, because that would have confused
me, and proved that I don't understand Path.

The variable being referred to is PATHEXT not PATH. I am not sure if it
would work on Win 98, though (I still haven't turned on the Win 98
machine).

Sinan.
 
J

Jay Tilton

: The variable being referred to is PATHEXT not PATH. I am not sure if it
: would work on Win 98, though (I still haven't turned on the Win 98
: machine).

Setting PATHEXT has no effect on non-NT-flavored MS systems.
 
J

Joe Smith

Mike said:
system 'start lltost.fch' does work, thanks to Sinan pointing
that out. Not sure why 98 needs that 'start' in there, but
apparently it does.

The argument to perl's system() function needs to be the name
of an executable program or command, not a document.
The 'start' command determines which application to run
based on the document's name.
 
M

Michele Dondi

Yeah, but it doesn't seem to keep a historical record of
typed lines that can be recalled with the up arrow.

While I largely agree on the former cmt, doskey has been there and
useful[*] at least as of DOS5.0 (the one I began with).
That's why I say it sucks. I need to see if I can
find another one that I like better.

See if this helps you:
What on God's Orange Titan is lltost.fch??? Does that file exist? Is that
really an executable? If not, does the associated application exist? If it
does, have you tried
[snip]
It is a programing language that I create with the
Perl script and then execute immediately.

HUH?!?


[*] Albeit only a tiny fraction of how useful history management of
e.g. bash is.


Michele
 
M

Michele Dondi

Thanks.

Wow, 250 MB! That's quite a program.

I must admit I posted that link, but I'm not really sure what's in
there (why I had it in the first place? Long story!)

However IIRC it says something about cygwin, and yes: installing
cygwin may be expensive in terms of disk space, but that depends on
what you actually want to install.

Personally if I have to use a *NIX-like system I use Linux. If I have
to use Windows, I use Windows, and I've never felt the real need to
have a full emulation layer. Since every now and again I _do_ feel the
need to use under Windows some standard *NIX tools, I use the native
ports from UNXUTILS/UNXUPDATES. Granted, due to the basic differences
between the operating systems they were thought for and Win*, they do
not _all_ work seamlessly. For example chown is included in the
collection, but it doesn't work at all (under 98, that is), however I
wouldn't use there in any case ...
Maybe I should say it is a scripting language that I write
with perl and then execute immediately.

Did you create a scripting language? Not to underestimate you, but
language design in general is not a trivial task, you know...


Michele
 
M

Mike Flannigan

Michele Dondi wrote:

snip
Did you create a scripting language? Not to underestimate you, but
language design in general is not a trivial task, you know...

No, it is a commercial package. It mostly just sends
various keystrokes to programs (windows). Alt s -
Ctrl n - etc. It has some other functions too, but I
mostly use it to send keystrokes. I can generally
do it's other functions with Perl.

I suspect there is a Perl way to send the keystrokes too.
In fact I suspect Win32::CtrlGUI::Window would do
everything I need. I need to learn that module and
throw away that commercial scripting language package.


Mike
 
E

Eric Bohlman

I suspect there is a Perl way to send the keystrokes too.
In fact I suspect Win32::CtrlGUI::Window would do
everything I need. I need to learn that module and
throw away that commercial scripting language package.

Win32::GuiTest provides a SendKeys() function that should do what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top