system command on Win98

Discussion in 'Perl Misc' started by Mike Flannigan, Jan 15, 2005.

  1. 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
     
    Mike Flannigan, Jan 15, 2005
    #1
    1. Advertising

  2. In article <> posted on Sat, 15 Jan 2005
    16:18:48 +0000, Mike Flannigan wrote:

    > 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

    --
    A. Sinan Unur
    d -- remove invalid and
    reverse each component for email address.
     
    A. Sinan Unur, Jan 15, 2005
    #2
    1. Advertising

  3. Mike Flannigan

    Sisyphus Guest

    Mike Flannigan wrote:
    > 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

    --
    To reply by email u have to take out the u in kalinaubears.
     
    Sisyphus, Jan 15, 2005
    #3
  4. "A. Sinan Unur" wrote:

    >
    > 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.


    > > I also see that the shell on Win98 sucks.

    >
    > 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.


    > > 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


    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
     
    Mike Flannigan, Jan 15, 2005
    #4
  5. Sisyphus wrote:

    > 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
     
    Mike Flannigan, Jan 15, 2005
    #5
  6. Mike Flannigan <> wrote in
    news::

    >
    > "A. Sinan Unur" wrote:


    >> > I also see that the shell on Win98 sucks.

    >>
    >> It works.

    >
    > 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.

    >> > 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

    >
    > 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.

    >> 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.


    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. Sinan Unur, Jan 15, 2005
    #6
  7. Mike Flannigan <> wrote in
    news::

    >
    > Sisyphus wrote:
    >
    >> 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.)


    > 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.
     
    A. Sinan Unur, Jan 15, 2005
    #7
  8. Mike Flannigan

    Jay Tilton Guest

    "A. Sinan Unur" <> wrote:

    : 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.
     
    Jay Tilton, Jan 16, 2005
    #8
  9. Mike Flannigan

    Joe Smith Guest

    Mike Flannigan wrote:

    > 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.
     
    Joe Smith, Jan 16, 2005
    #9
  10. On Sat, 15 Jan 2005 22:35:33 GMT, Mike Flannigan
    <> wrote:

    >> > I also see that the shell on Win98 sucks.

    >>
    >> It works.

    >
    >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:
    <http://home.wanadoo.nl/fvu/Projects/Bash/Web/bash.htm>

    >> 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
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jan 16, 2005
    #10
  11. Michele Dondi wrote:

    >
    > 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).
    >
    >
    > See if this helps you:
    > <http://home.wanadoo.nl/fvu/Projects/Bash/Web/bash.htm>
    >


    Thanks.

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


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

    >
    > HUH?!?


    Maybe I should say it is a scripting language that I write
    with perl and then execute immediately.


    Mike
     
    Mike Flannigan, Jan 16, 2005
    #11
  12. On Sun, 16 Jan 2005 19:54:35 GMT, Mike Flannigan
    <> wrote:

    >> <http://home.wanadoo.nl/fvu/Projects/Bash/Web/bash.htm>

    >
    >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 ...

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

    >>
    >> HUH?!?

    >
    >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
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jan 17, 2005
    #12
  13. 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
     
    Mike Flannigan, Jan 19, 2005
    #13
  14. Mike Flannigan

    Eric Bohlman Guest

    Mike Flannigan <> wrote in news:41EE90AC.2AF65675
    @earthlink.net:

    > 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.
     
    Eric Bohlman, Jan 20, 2005
    #14
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gordon

    Unicode Support In chinese Win98

    Gordon, Oct 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    355
    Gordon
    Oct 22, 2003
  2. Vanga Sasidhar
    Replies:
    1
    Views:
    447
    Bruno Sirianni
    Apr 3, 2004
  3. =?Utf-8?B?V2FzaSBSZWhtYW4=?=

    How can I run WebService on Win98 System

    =?Utf-8?B?V2FzaSBSZWhtYW4=?=, Jul 3, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    538
    MS News \(MS ILM\)
    Jul 4, 2004
  4. Mustufa Baig

    Problem viewing .aspx pages from Win98..

    Mustufa Baig, Nov 16, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    447
    Gerry
    Nov 17, 2004
  5. Bernard
    Replies:
    4
    Views:
    5,406
    Raymond DeCampo
    Jan 3, 2006
Loading...

Share This Page