Tracert to Email

855 views Asked by At

I'd like to receive result of tracert information from my customer, however, they are not IT savvy.

Is there any ways we can get the tracert result be sent to an email or a web-form?

Any written bat files or open source programme available?

2

There are 2 answers

0
mojo On

clip.exe sends stuff to the clipboard.

You could put this into a batch file.

tracert targethost | clip

Then have them run the batch file and paste (the batch file did the copy—the client doesn't need to select/highlight anything) into an email. Surely non-savvy clients can send email.

0
zhenguang On

I've wrote an alternative solution that allow users to upload their traceroute result using a bat file.

IPADDRESS - The ip Address that you'd like to trace
USERNAME - The FTP username
PASSWORD - The Password for the FTP user
HOSTNAME - The FTP Host name

Create a traceroute.bat

@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"

set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"

ECHO Please wait....

tracert IPADDRESS > tracert-%fullstamp%.log
echo user USERNAME> ftpcmd.dat
echo PASSWORD>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put tracert-%fullstamp%.log>> ftpcmd.dat
echo quit>> ftpcmd.dat

ECHO Please allow FTP to upload the results...

ftp -n -s:ftpcmd.dat HOSTNAME
del ftpcmd.dat
del tracert-%fullstamp%.log

ECHO Uploading complete! You may now exit
@pause