I have an oneliner (perl 5 on Windows 7/10):
C:\Windows>perl -e "$x=system('echo c:\users');print $x";
which gives me the expected outputs:
c:\users
0
But if I have this:
C:\Windows>perl -e "$x=system('explorer c:\users');print $x";
this gives me:
256
and opens the folder.
I'm curious why the output is not 0 since the command executed correctly.
Similar question is here but it was not answered. This question here is more concrete. Maybe somebody can answer this specific issue.
UPDATE 1:
(1) I corrected the path from c:\user to c:\users. The former path was wrong and file explorer C:\Users\giordano\Documents was opened. With this correction the correct file folder is openend but still returns 256.
(2) Better coding:
C:\Windows>perl -e "system('explorer c:\users');print $?";