Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Windows start /min

by Beechbone (Pilgrim)
on Apr 19, 2007 at 10:21 UTC ( #610924=note: print w/ replies, xml ) Need Help??


in reply to Re: Windows start /min
in thread Windows start /min

and

$ perl -e 'system("cmd /c start /min notepad") and die $!;'
works with Cygwin's Perl. (But note the required "cmd /c")

Search, Ask, Know


Comment on Re^2: Windows start /min
Download Code
Re^3: Windows start /min
by Anonymous Monk on Oct 10, 2012 at 11:02 UTC
    Hi,

    I am having trouble with the "start" command.

    Here is the contents of the PERL5SHELL environment variable:

    c:\>echo %PERL5SHELL% cmd.exe /c
    Calling the "dir" command works fine:
    c:\>perl -e "system(\"dir\")" Datenträger in Laufwerk C: ist SYSTEM Volumeseriennummer: CA02-1E1F Verzeichnis von c:\ 03.08.2012 14:24 <DIR> cygwin 09.10.2012 18:01 <DIR> Daten ... 10.10.2012 08:59 <DIR> Windows 2 Datei(en), 15.460 Bytes 15 Verzeichnis(se), 144.527.847.424 Bytes frei
    Calling "start dir" from Perl does not work:
    c:\>perl -e "system(\"start dir\")" start: dir: Das System kann die angegebene Datei nicht finden.
    Calling "start dir" directly opens a new window with the output from above:
    c:\>start dir
    Any idea what might cause this behaviour??

    Yours

    Markus

      Calling "start dir" directly opens a new window with the output from above:

      If you don't want a new window, use the /b option: start /b dir.

      But I suspect that your real problem is the one haven't described. Ie. Why are you using start, rather than running dir directly?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

      Any idea what might cause this behaviour??

      You have some kind of "start" program? You're loading a module which replaces system and looks for a start.exe?

      Maybe cmd.exe changed again, but I don't think so, look

      C:\>start blahblah The system cannot find the file blahblah. C:\>perl -e " system q/start blahblah/" The system cannot find the file blahblah.
      Notice it doesn't say "start: dir: The system cannot find the file blahblah."
      Calling "start dir" from Perl does not work:
      c:\>perl -e "system(\"start dir\")" start: dir: Das System kann die angegebene Datei nicht finden.
      dir is not a exe, it is a shell built in. start is also a shell built in. You will not find a start.exe in your C:\WINDOWS or any subfolder under that. Only cmd understands what dir is.

      try
      perl -e "system('cmd /c dir');"
      or
      perl -e "system('cmd /c start dir');"
        FWIW, perl -le "system \"dir\"" works just fine, but then I don't have any autoloaded modules, no sitecustomize, no PERL env vars to override any defaults

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://610924]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2014-08-20 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls