Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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. I tried just putting in ping 216.52.241.254 -t and it just spams it over and over again.

like image 889
MichaelCX Avatar asked May 10 '14 02:05

MichaelCX


1 Answers

Another way of doing this (potentially a lot easier for you) would be to create a shortcut:

  1. Right Click in windows explorer and hover over "New"
  2. Select "Shortcut"
  3. A dialogue will pop-up. Enter the command you wish to utilize: ping 216.52.241.254 -t
  4. Click Next and name the file.
  5. 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.

like image 55
Monacraft Avatar answered Sep 22 '22 22:09

Monacraft