Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8818147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:01:46+00:00 2026-06-14T05:01:46+00:00

my $exe = ‘C:/Program Files/Common Files/executable.exe’; if(! -X $exe) { print exe file not

  • 0
my $exe = "'C:/Program Files/Common Files/executable.exe'";

if(! -X $exe) {
    print "exe file not found";
    exit 3;
}

my $cmd = $exe.' status';
@lines = qx ( $cmd );

My problem is that I can execute this command just fine, but I cannot for the life of me figure out how to check for the existence of the exe-file. Any hints? I have tried different sorts of quotation marks, -f, -X, -e … nothing works! Any help is much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:01:47+00:00Added an answer on June 14, 2026 at 5:01 am

    The -f operator would work fine, except that you have superfluous quotation marks in your filename.

    Of course all that -f tells you on Windows is that the file exists and isn’t a directory, but presumably that is all that you need.

    Additional double quotes do need to be put in the command line around the executable file’s name if the path contains whitespace, but it’s best to do that at the point you need them and no earlier. Try this:

    my $exe = 'C:/Program Files/Common Files/executable.exe';
    
    unless (-f $exe) {
        print "exe file not found";
        exit 3;
    }
    
    my $cmd = qq("$exe" status);
    my @lines = qx($cmd);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

after i execute .exe and .bat files and close them, system does not let
‘php.exe’ is not recognized as an internal or external command, operable program or batch
I try to execute .exe file using nsIProcess. But it is not working and
my .exe and addrr.txt files are located on D:\ drive when im trying to
I am running ffmpeg.exe through a Java code to encode a video file. How
Im trying to run exe file with c++ with no luck I tried this:
I have the .exe of a program which has been generated from C++. Is
Metrics.exe: error: The referenced assembly 'Exception.dll, version=1.0.5289.9, Culture=neutral, publickeytoken=67er8..' could not be found. This
Say I make an .exe file and everything is peachy. Wonderful it works. Say
I have some exe files that I've uploaded into my database as I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.