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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:40:11+00:00 2026-05-23T01:40:11+00:00

Newbie to windows scripting. I need help running the .bat file on the command

  • 0

Newbie to windows scripting. I need help running the .bat file on the command line so I can test it.
I used Text Document as my editor to create the file (opens up also as Notepad).

I performed file “save as” (ALL FILES). If I open up cmd, I can see the file has a .txt extension (myfile.bat.txt). So if I just type in cmd myfile.bat.txt the editor opens. I am not sure how to execute this correctly.

As for the logic in my batch script, I am basically logging into a remote directory (already created the net mount) and now I want to:

  1. run an executeable file
  2. rename some files.

With some research, I written this so far. I have saved it as a .bat file

@ echo off
echo This is a batch file to run an executable and rename some files
pause
--run executable file here, just don't know how to do it
x:
cd x:
rename fileA fileB

Any help, good tips/practice would be great. 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-05-23T01:40:12+00:00Added an answer on May 23, 2026 at 1:40 am

    Type in this command in cmd window:

    rename myfile.bat.txt myfile.bat
    

    Now you can run the script by simply invoking:

    myfile.bat
    

    or

    myfile
    

    (provided there’s no myfile.exe or myfile.com in the same directory).

    If you need to edit the script further, you can either right click it in Explorer and choose Edit or call the editor from the command window:

    notepad myfile.bat
    

    To call a program from the script, simply add its name, if it’s in the current directory:

    someprogram.exe
    

    or the name with the path, if it’s somewhere else:

    directory\program.exe
    

    or

    d:\directory\program.exe
    

    If the name or the path contain spaces, be sure to enclose the entire name & path string in double quotes:

    "d:\directory\program name.exe"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm newbie in iOS dev. I need windows with tree views on it. I
Newbie: help switching locale with JSF Hi, I hope someone can help, I am
.NET newbie here... I'd like to make a button in a Windows form that
Newbie here...can I write one program which incorporates .NET LINQ and also various Java
I am a newbie to VBS scripting. Thanks for all your comments! I fixed
I am newbie to Windows Azure application. I have downloaded the Microsoft Visual Studio
I'm a complete newbie to Windows and COM programming, trying to use com4j in
I am a newbie Linux user who came from 10 years using windows OS,
I am newbie. I have Windows XP and use the CodeIgniter framework. I wanted
I am a bit of a newbie when it comes to windows client programming.

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.