I am trying to create a .bat file in order to ping a website and output the result to a .txt file named result.txt on the desktop of the machine.
I am doing something like this but it is not the correct code I guess;
ping google.com >> c:\list.txt
|
I am trying to create a .bat file in order to ping a website and output the result to a .txt file named result.txt on the desktop of the machine. I am doing something like this but it is not the correct code I guess;
| |||||||||
feedback
|
|
The command should work fine. However, if you want to save it to the desktop of the machine, you need to change the path. C:\list.txt will save it to the root directory, not the desktop. You can find the desktop at %USERPROFILE%\Desktop, so your command would look like this:
| |||||||||||||||||
feedback
|
|
You'll need to run the command (or bat / cmd file) 'as Administrator' to save to the C:\ directory. Other than that the command successfully worked for me, saving each ping results to the C:\lists.txt file.
Or
| |||
|
feedback
|