In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
In this article Xiaobian introduces in detail "what is the new window execution command of bat script", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "what is the new window execution command of bat script" can help you solve your doubts.
Open a new window with the bat script to output hello world:
Start "" cmd / k "echo hello world"
"" indicates that the new window has no title or the title is empty
/ k means that the new window is not closed after the command is executed, and / c means the window is closed after execution.
1. Use the bat script to open a new window titled tom, output hello, and output world two seconds later
Timeout / T2 countdown to two seconds, some people like to use ping, (ping 127.1-N2 > nul)
The & & symbol is needed to output multiple commands, and the output of the new window needs to be marked with quotation marks. If you do not type "", the first command will be executed in the startup script window, not in the new window.
Start "tom" cmd / k "echo hello&& timeout / T2 & & echo world"
2. How to cancel the edit insert mode of the newly opened window to prevent the window from getting stuck and the service not running when the mouse clicks on the new window.
Copy the command at the front of the script, and all newly opened windows in the script will turn off edit and insert mode by default.
Reg add HKEY_CURRENT_USER\ Console / v QuickEdit / t REG_DWORD / d 00000000 / f
3. How to control the size of the newly opened window
Define variables at the beginning of the script
Set evn1=mode con cols=70 lines=25
Cols is the window length, lines is the window width (it is not clear whether the percentage is not clear)
Call variable method:% evn1%
Start "tom" cmd / k "% evn1% & & echo hello&& timeout / T2 & & echo world"
4. Set the title manually
Title kimistart "" cmd / k "% evn1% & & title kimi & & echo hello&& timeout / T2 & & echo world"
5. Set the address
Open a new window under the a directory of the E disk
Start "" / d E:\ a cmd / k "echo hello world"
Comprehensive:
Create a batch script, under the a directory of the E disk, open a window titled a, set the size, update and package the git code in the a directory, and start the test.jar package in the subdirectory target
@ echo off::= configuration variable = rem at the beginning of the word set address path_aset path_a=E:\ arem set window size set evn1=mode con cols=70 lines=25::= start = rem forbid new window to start editing and insert mode reg add HKEY_CURRENT_USER\ Console / v QuickEdit / t REG_DWORD / d 00000000 / fstart / d E:\ a cmd / k "% evn1% & & git pull & & mvn install & cd target & & title a & java-jar test.jar"
Add pause at the end of the rem script, wait for any input after the script is executed, exit, and close the script execution window directly if you don't add the script.
Add: how windows bat launches a new cmd window and executes commands in it
There are two ways:
one,
Start cmd / k echo Hello, World!
two,
Start cmd / C pause
The difference is that after the second type of execution, the newly opened window will close automatically, while the first one will not.
After reading this, the article "what is the new window execution command of bat script" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it. If you want to know more about the article, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.