ankit.tayal560 has asked for the wisdom of the Perl Monks concerning the following question:

$me="C:/ProgramData/Microsoft"; $me.="/Windows/"; $me.="Start Menu"; $me.="/WinZip"; system("$me");

it shows an error " not an external or internal command, operable program or batch file" how can I resolve it?

  • Comment on C:\ProgramData\Microsoft\Windows\Start Menu is not an internal or external command,operable program or batch file
  • Download Code

Replies are listed 'Best First'.
Re: C:\ProgramData\Microsoft\Windows\Start Menu is not an internal or external command,operable program or batch file
by marto (Cardinal) on Aug 29, 2016 at 10:33 UTC

    I'm not sure why you're building your path up like this, however here's an example based on running d:\program files\ffmpeg\bin\ffmpeg.exe:

    $me = "d:\\program files"; $me .= '\\ffmpeg\\'; $me .= 'bin'; $me .= '\\ffmpeg.exe'; system('start "" "' . $me . '"');

      if i want to run this "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2013\Word 2013" what should I do?

      this can be started from its full file path but I want to start it from start menu file path for some required specific purpose.can you help me out in this?

        That's a path of a directory, not an executable. Are you trying to launch windows explorer opened at this path? If you want to actually launch Microsoft word provide the full path to the executable (like the example I gave you for ffmpeg.exe), in my case (it won't be the same for you):

        my $word = 'C:\\Program Files (x86)\\Microsoft Office\\Office12\\winwo +rd.exe'; system('start "" "' . $word . '"');

        Update: also, see http://learn.perl.org and the Tutorials section.

        There is no file named "Word 2013" , it doesn't exist

        "Word 2013.lnk" probably does exist

        Even if "Word 2013" really existed, you could never execute/start it as its not a program/executable or a link

Re: C:\ProgramData\Microsoft\Windows\Start Menu is not an internal or external command,operable program or batch file
by Anonymous Monk on Aug 29, 2016 at 10:17 UTC
    Try using the full filepath

      I am able to open it by full file path but if I want to open the required program through shortcut only. what should I do? plz suggest

        I am able to open it by full file path but if I want to open the required program through shortcut only. what should I do? plz suggest

        Give the full path to the shortcut