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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:48:14+00:00 2026-06-16T09:48:14+00:00

I found the solution to run an executable file (.bat or .exe) from a

  • 0

I found the solution to run an executable file (.bat or .exe) from a local html page in Firefox – it is documented very well here

However, I need to start the executable in the folder where it is located. My executable is a .bat file (D:\Test\file.bat) and it contains the command:
echo %cd%

When I run it, it prints:

C:\Programs\FirefoxPortableLegacy36

instead of printing

D:\Test

Is there any way to specify in the htm/javascript where exactly (in which directory) to start my executable?

thanks.

  • 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-16T09:48:15+00:00Added an answer on June 16, 2026 at 9:48 am

    So you want to make the working directory set to the directory where your batch script is? If this is the case then just add this line right in the beginning of your batch script:

    pushd "%~dp0"
    

    You can also read the commandline help for the for command. It explains the parameter replacement well.

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

Sidebar

Related Questions

Following the solution found at Can I access session state from an HTTPModule? ,
I've run accross this problem many times and still haven't found the solution or
I converted my solution to run with VS2010 from VS2008. But I'm still running
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to
I have tried to run an executable 'crcor' with the command ben-Aspire-S3-391:/usr/local/src/runz% /usr/local/src/runz/crcor /usr/local/src/runz/crcor:
Seems, it's common task, but I haven't found solution. I need to calculate number
Edited: SOLUTION FOUND. This is strange and not the best solution, but I just
Update Solution Found See Bottom of post if interested Seems simple enough and for
I found the solution for this question in C# , but I can't translate
[edit] Found the solution. Reinstall EVERYTHING - xcode, mono, monodevelop and monotouch. Now it

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.