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 9210949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:11:19+00:00 2026-06-18T01:11:19+00:00

I am using mr on Windows and it allows running arbitrary commands before/after any

  • 0

I am using mr on Windows and it allows running arbitrary commands before/after any repository action. As far as I can see this is done simply by invoking perl’s system function. However something seems very wrong with my setup: when making mr run the following batch file, located in d:

@echo off
copy /Y foo.bat bar.bat

I get errors on the most basic windows commands:

d:/foo.bat: line 1: @echo: command not found
d:/foo.bat: line 2: copy: command not found

To make sure mr isn’t the problem, I ran perl -e 'system( "d:/foo.bat" )' but the output is the same.

Using xcopy instead of copy, it seems the xcopy command is found since the output is now

d:/foo.bat: line 1: @echo: command not found
Invalid number of parameters

However I have no idea what could be wrong with the parameters. I figured maybe the problem is the batch file hasn’t full access to the standard command environment so I tried running it explicitly via perl -e 'system( "cmd /c d:\foo.bat" )' but that just starts cmd and does not run the command (I have to exit the command line to get back to the one where I was).

What is wrong here? A detailed explanation would be great. Also, how do I solve this? I prefer a solution that leaves the batch file as is.

  • 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-18T01:11:20+00:00Added an answer on June 18, 2026 at 1:11 am

    The echo directive is executed directly by the running command-prompt instance.
    But perl is launching a new process with your command. You need to run your script within a cmd instance, for those commands to work.

    Your cmd /c must work. Check if you have spaces in the path you are supplying to it.
    You can use a parametrized way of passing arguments,

    @array = qw("/c", "path/to/xyz.bat");
    system("cmd.exe", @array);
    

    The echo directive is not an executable and hence, it errors out.
    The same is true of the copy command also. It is not an executable, while xcopy.exe is.

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

Sidebar

Related Questions

When creating a child process in C++ using Windows API, one can allow inheritance
Iam using windows forms. How can I query all child controls of a Form
On Windows it is possible to have a service that allows clients running in
I tested my installer on netbook running Windows 7 Starter logged in using a
I have DotNetZip installed and running fine on a Windows 2008 server. Using a
For the record, I am using Windows XP SP3, running FireFox 5 and IE
Using Windows So I'm reading from a binary file a list of unsigned int
Using windows server, I have a path to a file that, when you click
Using Windows Mobile 6.5 and C# The CharacterCasing property seems to be missing from
Using Windows form (Vb.net & Datagridview) Checkbox is using in datagridview row. I want

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.