Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
XP is just a number
 
PerlMonks  

Re^3: Windows start /min

by Anonymous Monk
on Oct 10, 2012 at 11:02 UTC ( #998198=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^3: Windows start /min
Select or Download Code
Re^4: Windows start /min
by BrowserUk (Pope) on Oct 10, 2012 at 11:06 UTC
    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

Re^4: Windows start /min
by Anonymous Monk on Oct 10, 2012 at 11:10 UTC

    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."
Re^4: Windows start /min
by bulk88 (Priest) on Oct 10, 2012 at 21:58 UTC
    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://998198]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2014-04-20 03:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls