[英]Creating a bat file that runs a certain command on cmd
So normally I can type this into the cmd
window ping 216.52.241.254 -t
and it tells me my ping to a certain server. 所以通常我可以在
cmd
窗口ping 216.52.241.254 -t
键入它,它告诉我我对某个服务器的ping。 How can I create a .bat
file that automatically opens the cmd
window and types it in so that I don't have to write it out every single time. 如何创建一个自动打开
cmd
窗口并将其键入的.bat
文件,这样我就不必每次都写出来。 I tried just putting in ping 216.52.241.254 -t
and it just spams it over and over again. 我试着直接输入
ping 216.52.241.254 -t
,它只是ping 216.52.241.254 -t
它。
Another way of doing this (potentially a lot easier for you) would be to create a shortcut: 另一种方法(可能对您来说更容易)是创建一个快捷方式:
New
" New
”上 Shortcut
" Shortcut
” ping 216.52.241.254 -t
ping 216.52.241.254 -t
The advantage of this method over the other is its simpler and allows you to pin it to the Starmenu or Taskbar. 这种方法优于另一种方法的优点是它更简单,并允许您将其固定到Starmenu或任务栏。
Mona. 莫娜。
它一遍又一遍地发送垃圾邮件,因为你调用了批处理文件ping
所以它自己启动了。
Very simple: 很简单:
@echo off
ping 216.52.241.254 -t
Echo.
pause
.bat
file, ensuring that you select " all files
" option .bat
文件,确保选择“ all files
”选项 Done! 完成!
type the following: 输入以下内容:
cd\
ping -t 216.52.241.254
It spams it again and again because you used -t which "Pings the specified host until stopped." 它一次又一次地垃圾邮件,因为你使用了-t“指定主机直到停止”。 if you lose the -t it won't do that.
如果你失去-t就不会那样做。 Type Ping /?
输入Ping /? to look through all the options available when using ping and select what is appropriate for what you want it to do.
查看使用ping时可用的所有选项,并选择适合您希望它执行的操作。
You must have keep the file name as ' ping.bat '. 您必须将文件名保留为“ ping.bat ”。 Rename it to something else and it will definitely work.
将它重命名为其他东西,它肯定会起作用。 ex : ping1.bat, something.bat etc., anything else but ping.
例如:ping1.bat,something.bat等,除了ping之外的其他任何东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.