Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the skills of using batch file .bat

Shulou Source: shulou.com Published: 2022-06-03 08:29:57 10月06日 Update

This article mainly shows you the "batch file .bat use skills", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "batch file .bat use skills" this article.

You can learn about the basic commands and methods such as the addition and deletion of system services, as well as file replication. In addition, using batch files, you can more easily extend shortcut operations.

For example, to open a directory, the code would look like this:

The code is as follows:

Start D:\ Zend

That is, open the Zend folder under the root directory of disk D.

To access a URL, the code is in the form of:

Explorer http://localhost

That is, browse the Web service of the local server.

Combined with the three batch files mentioned in the ZendCore,Apache+MySQL+PHP environment suite, we can organize these functions in the new .bat file and collect server shortcuts to facilitate the management of the Web server environment.

Create a new zend.bat file and copy and paste the following code:

Echo off: begin cls echo 1. Start the server echo 2. Restart the server echo 3. Stop the server echo 4. Access the root directory echo 5. Run the browser echo 6. Open the database echo 7. Management console echo 8. Exit this program set / Pi = (1if / I) > nul if / I "% I%" = = "1" start "" start .bat "if / I"% i% "=" 2 "start"restart .bat" if / I "% i%" = "3" start "stop .bat" if / I "% i%" = "4" start D:\ Zend\ Core\ htdocs if / I "I"% % "=" 5 "explorer http://localhost if / I"% I% "= =" 6 "explorer http://localhost/phpMyAdmin if / I"% I% "=" 7 "explorer http://localhost/ZendCore if / I"% I% "= =" 8 "exit cls goto begin

In this way, you can quickly start programs and documents by typing the corresponding digital symbols in the command state, which is very convenient and practical.

The above is all the contents of this article entitled "what are the tips for using batch files? bat". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Files services servers code skills content articles commands forms environment directories programs learning help browsing management utility and so on Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei OPPO Reno vpn Shulou Technology Shulou Information