How To Run A Program With A Bat File

Table of contents:

How To Run A Program With A Bat File
How To Run A Program With A Bat File

Video: How To Run A Program With A Bat File

Video: How To Run A Program With A Bat File
Video: How to create a Batch file that runs Programs 2024, December
Anonim

The bat file is an executable file in the Windows operating system environment. With its help, you can implement the launch of applications, documents, programs to save time for computer users.

How to run a program with a bat file
How to run a program with a bat file

Instructions

Step 1

Run the "Notepad" program to create a Bat-file. Next, enter the text of the file. It will be different depending on what you want it to run. For example, create a bat-file for connecting to the Internet if your connection asks for a username and password.

Step 2

This can be done if the Internet access itself is already configured and the shortcut for connecting to the Internet exists. In the file you need to enter the following text: Radial "Enter the name of the connection" "Enter the login" "Enter the password". For example, radial megafon-moskva sdk23SsdkP1 125523.

Step 3

Save the resulting file. To do this, run the command "File" - "Save As", enter any file name, then enter the extension *.bat. Now you can add a shortcut for the file to startup so that the Internet connection is automatically established when the operating system starts.

Step 4

Use the start command when creating a Bat file to launch applications. To do this, enter the following text in the file: start "Enter the full path to the program / file." Please note that long folder and file names must be abbreviated using the ~ symbol, for example, instead of C: / Program Files, enter C: / Progra ~, provided that there are no more folders on the disk that start with these characters.

Step 5

Save the file in the same way as in step 3. If you save the batch file to run the program in the program folder, there is no need to write the full path to the application in it, you only need to specify the executable file, for example, start "Winword.exe". You can place the shortcut for this file anywhere on the computer. You can also use batch files to create files, for example, to create a file named Program.txt on disk C, use the following command: @echo Start file> C: /Program.txt.

Recommended: