Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

ping with timestamp

ping -w 5000 -t -l 4000 -4 localhost|cmd /q /v /c "(pause&pause)>nul &for /l %a in () do (for /f "delims=*" %a in ('powershell get-date -format "{ddd dd-MMM-yyyy HH:mm:ss}"') do (set datax=%a) && set /p "data=" && echo([!datax!] - !data!)&ping -n 2 localhost>nul"
Comment

Ping with Timestamps

@echo off

set /p host=host Address: 
set logfile=Log_%host%.log

echo bmycaspian.com = %host% >%logfile%
for /f "tokens=*" %%A in ('ping %host% -n 1 ') do (echo %%A>>%logfile% && GOTO Ping)
:Ping
for /f "tokens=* skip=2" %%A in ('ping %host% -n 1 ') do (
    echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A>>%logfile%
    echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A
    timeout 1 >NUL 
    GOTO Ping)
	
Comment

PREVIOUS NEXT
Code Example
Shell :: add and remove users in Linux 
Shell :: how to install imagemagick in linux 
Shell :: wsl screen permission denied 
Shell :: google translate for linux 
Shell :: how to install gnu lib tool 
Shell :: docker compose rebuild image 
Shell :: enospc no space left on device 
Shell :: Connect to a VM instance by using SSH. 
Shell :: composer global install 
Shell :: find text pattern in file linux 
Shell :: and in bash 
Shell :: $path mac 
Shell :: linux rename multiple files 
Shell :: ssh connect command 
Shell :: bash delete swap file 
Shell :: shell trim 
Shell :: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? 
Shell :: find home dir for user 
Shell :: how to uninstall a aur package 
Shell :: ingnore large files in github 
Shell :: git stash docs 
Shell :: node js 16 install ubuntu 20.04 
Shell :: cmake run cmake clean 
Shell :: opencv tutorial python 
Shell :: Run Google Colab With Local Files 
Shell :: scp with ssh key 
Shell :: Merging multiple kube config files in to one 
Shell :: checkout remote branch 
Shell :: kill tomcat ubuntu 
Shell :: graphviz windows install 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =