answersLogoWhite

0

How do you save a batch file?

Updated: 10/3/2023
User Avatar

Wiki User

13y ago

Best Answer

Open up a notepad.

Type in the the batch parameter you need to run.

Then save it as a .bat file.

File > Save as > myfile.bat

Example:

If you need to to copy a file (filename picture001.jpg) in C: drive to the D: drive, you can create the batch to do the task by typing the following parameter in the batch file.

xcopy [path of the file] [destination path]

xcopy C:\picture001.jpg D:

Now save it as a batch file and double click to run it.

Enjoy!

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

The most common way to make a batch file is with notepad. You type the code in a new text document but when you save it, save it as a .bat file.

The batch file should now appear on the directory you saved it.

You can get basic help on getting started with batch scripts at the Microsoft page below.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

You could type the command lines (those lines that you want the CMD to run) on Notepad (you know it right?? :) and then save it, give it a name then add '.bat' at the back, it'll make it extension.

Or just save as a notepad document (.txt), then rename the .txt to .bat and when it asks you something like 'are you sure you wanna change it because the file might be unusable' something like that appears, just click yes, choose to rename the extension still.

Now double-click the newly saved file and it'll be ran by the Command Prompt.

Good luck, enjoy :)

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

By how simple and for what function? I have a example of a simple batch file:

@echo off

echo Hi

echo.

pause

exit

This batch file just displays a note, waits for a key to be pressed, and exits

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

A batch file is a text file with a .bat extension.

If you created a batch file in notepad, select File/ Save As.... After selecting a directory/ folder, enter a file name with a .bat extension and change the line under the file name from ".txt files" to "all files".

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

So if you have a powercut or something, you will have the files backed up.

Hope I'm talking about the right thing!

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you save a batch file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is Batch File Maker?

you can use notepad for creating a batch file. just when you save the file that you made, add .bat as a file extension. like this: "sample.bat".


How is batch file created?

1. open notepad2. save file as yournameforthefilehere.bat


How to create a batch file and impliment it?

To create a batch file open notepad, textedit, or whatever editor you wish to use. Once open write your program, check for errors, and "make simple text." Save this program as whateveryouwant.bat. Open the file and the batch file will execute.


How do you make bat files?

You can make a batch file from a note pad by saving it as YOURFILENAME.bat. Click on FILE on the menu and choose SAVE AS, then save it as YOURFILENAME.bat.


How can you run a file on startup using CMD?

Make a batch file. Open up notepad, type in the commands just like you would if you had a C:\prompt and choose "save as." When you save it, remove the .txt extension & use .bat instead. Batch files can be executed just like an .exe, any commands in the batch file are put to a command prompt & executed. So just put the batch file (or a shortcut to it) in programs/startup in your start menu & youre done!


What is the extension of batch file?

the extension of a batch file is ".bat"


How do you create and run a batch program?

Easy enough to create a batch program is you know what the commands are simply goto a text file or notepad and save it as "something.bat" and click on it


Can a file with a weird extension but with batch file code be read using another batch file?

Nope, the format of a file is a vital part of a successful batch file. Even if a file with an unknown file format contains working batch file code in it, a batch file will still not be able to read it because of its foreign file extension. If you want the batch file to be able to read the foreign file, then you can set it to rename the mutated file to .bat format and then read it for it to work. Example: @Echo off REN File.Foreign File.bat CALL File.bat exit


How do you make a batch file?

To create a batch file, click on Start > All Programs > Accessories > Notepad.Enter the commands you would like to execute.Click on File > Save. When prompted for a file name, you must select the file type "All Files (*.*)". Make sure the file name ends in ".bat", such as "dostuff.bat".The file will be saved in the folder you specified. It can be executed by double-clicking on the file.


What is a batch file?

A batch file is the text file that contains a series of commands that MS-DOS carries out. A batch file is created by COPY CON command after specifying a file name by using extension as .BAT in DOS mode.


How do you create a batch file on your computer?

You create a batch file by opening up a text editor, the standard windows one is Notepad. Next just start coding using dos commands, for a tutorial visit http://www.allenware.com/icsw/icswidx.htmOnce you finish writing your file just click File-->Save As--> fileName.batAlso choose all files under the "Save as Type" drop down menu.


How do you extract code from batch file?

You can just open the batch file with notepad and look at the code