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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:56:15+00:00 2026-06-13T18:56:15+00:00

I have a Windows BAT file that looks like this: Z: tool.exe c:\mypath\to\input c:\mypath\to\output

  • 0

I have a Windows BAT file that looks like this:

Z:
tool.exe c:\mypath\to\input c:\mypath\to\output \flag1 flag2

That is, tool.exe resides on a mapped network drive. The tool requires that the EXE is run from its own directory (Z: in this case).

The BAT works fine when run via double-click or in a CMD window.

I’d like to automate it through Ant. My attempt is here:

<target name="go">
    <exec executable="cmd">
        <arg value="/c"/>
        <arg value="runtool.bat"/>
    </exec>
</target>

It doesn’t work. From this link and other research, I understand the following:

  • “Z:” is likely the equivalent of “cd Z:\”
  • there is no “cd.exe”… “cd” is interpreted by the Windows CMD shell, and not available via “cmd.exe”

That said, how to achieve the goal in Ant? in Java?

I’m open to writing my own Ant task, doing further network configuration of the directories, etc. (At the risk of making the question too broad, we are using Jenkins and open to ideas there as well.)

  • 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-13T18:56:17+00:00Added an answer on June 13, 2026 at 6:56 pm

    This worked for me:

    <target name="go">      
        <property name="batFileDir" location="${basedir}/resources" />
    
        <exec executable="cmd" dir="." spawn="false">
            <arg line="/C start ${batFileDir}/runTool.bat"/>
        </exec>                
    </target>
    

    where the runTool.bat is as described in the question, and located in ~/resources.

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

Sidebar

Related Questions

I have created a .bat file that displays all the users logged in Windows
I'm using Sliksvn Windows client and have a DOS BAT file that contains the
On Windows XP system, I have test.bat C:\Path\to\php.exe -f C:\Path\to\test.php I also have test.php
I have a bat file that I am using to try and register Mobilink
I have a batch file run.bat that requires many arguments for it to run.
Let's say I have a foo.exe file that I want to use it from
Hey everyone. I have an exe file that runs a console program that was
I have the following problem. I got a bat file that runs testcomplete test.
I have a Hudson job that launches a .bat script file that itself launches
I have a .Bat file for testing that will kill my Chrome browser: @cls

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.