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

  • Home
  • SEARCH
  • 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 7934471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:39:26+00:00 2026-06-03T21:39:26+00:00

I have a Perl script that is calling a program on Windows using backticks.

  • 0

I have a Perl script that is calling a program on Windows using backticks. It works fine when I run it in the command prompt. It stops working when I run it using Windows task scheduler. This is on Windows Server 2008 x64 with ActiveState Perl. It gives me an error is not recognized as an internal or external command, operable program or batch file. Once I change my call to the program to point to the full path of the program it works again.

So something about when its run in a task schedule with backticks prevents it from seeing the windows environmental variables, specifically the %PATH% variable when its run. Something is maybe missing from the shell that’s spawned by the backticks? Should I be using a different command to perform the system calls? Or is there a task scheduler setting that will solve this? If anyone can assist I would appreciate it.

To be honest my environment is more complicated than this, but this is what I’ve narrowed it down to. I actually have a task schedule with a batch file that runs a php script which itself runs the perl script which then runs the program. The rest of the stack that I didn’t mention before does seem to have access to %PATH%, so the batch file runs ‘php …’ and the php script runs ‘perl …’ and then the perl script fails when running ‘programname’ using backticks. I’ve stripped away the batch file and php script and the behavior still persists with just the task scheduler and perl.

  • 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-03T21:39:27+00:00Added an answer on June 3, 2026 at 9:39 pm

    Running path from in perl basically helped me solve the problem. The problem isn’t perl itself, but the fact that changes to the %PATH% variable don’t show up to the task scheduler until the task scheduler service is restarted. As far as I know there’s no way to restart task scheduler without rebooting the machine. So the program path was not showing up when run in the task schedule but was showing up in the command line.

    I found two solutions to this.

    One is to just reboot the machine.

    The second is to make sure that your task schedule is set to ‘Run whether user is logged in or not’ (The closest command line parameter to that option is the /NP parameter for schtasks) For some reason running the schedule in that scenario gives it access to the current %PATH% variable. I’m not sure but I think this would break scripts that need to interact with the desktop though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Perl script that I'd like to run on Windows, using either
I have a Perl script that works on Windows XP. It uses File::Copy's move
I have a plain perl script that can be run from the command-line via
I currently have a Perl CGI script that parses incoming XML requests using XML::Simple
I have a Perl script that needs to run following an annual schedule with
I have a perl script that prepares files for input to a binary program
I have a Perl script that I've written and can compile it using pp
I have a Perl script that I'm attempting to set up using Perl Threads
I have a Perl script that uses WWW::Mechanize to read from a file and
I have a Perl script that takes text values from a MySQL table and

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.