Creating a bat file that runs a certain command on cmd
Solution 1
Another way of doing this (potentially a lot easier for you) would be to create a shortcut:
- Right Click in windows explorer and hover over "
New
" - Select "
Shortcut
" - A dialogue will pop-up. Enter the command you wish to utilize:
ping 216.52.241.254 -t
- Click Next and name the file.
- Now whenever you open the shortcut, it will execute the command.
The advantage of this method over the other is its simpler and allows you to pin it to the Starmenu or Taskbar.
Mona.
Solution 2
It spammed it over and over because you called the batch file ping
so it was launching itself.
Solution 3
Very simple:
@echo off
ping 216.52.241.254 -t
Echo.
pause
- Open Notepad
- Copy and paste this in.
- Save as a
.bat
file, ensuring that you select "all files
" option - Run the batch file any time you want to check your ping.
Done!
Solution 4
type the following:
cd\
ping -t 216.52.241.254
Solution 5
You must have keep the file name as 'ping.bat'. Rename it to something else and it will definitely work. ex : ping1.bat, something.bat etc., anything else but ping.
Admin
Updated on July 05, 2022Comments
-
Admin almost 2 years
So normally I can type this into the
cmd
windowping 216.52.241.254 -t
and it tells me my ping to a certain server. How can I create a.bat
file that automatically opens thecmd
window and types it in so that I don't have to write it out every single time. I tried just putting inping 216.52.241.254 -t
and it just spams it over and over again.