Command Line PING response

MarcMorgan

New member
Local time
10:32 PM
Messages
4
Hi All

Im not sure where to post this so i do apologise if this is in the wrong field:

I work within the IT department and i require to install some software etc on machines remotely on our network, the machines tend to be offline due to been portable computers so i wanted to see if there was a way to create a script or something so if did a ping response from command line (ping machine name -t) so that when the machines did actaully appear back on the network i would receive say an email from Microsoft Outlook (exchange)

This would be weather the command line has to stay open (which i know i could do with the Asstrix syntax but i dont want to keep it open, just have something to notify me when its back on our network
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
MAC
OS
Windows 7 x64bit
Welcome to the Seven Forums!

You can probably locate a software tool that will do this for you, but since you work in IT, you should learn to write these tools yourself. Adding that skill set to your repertoire could really help you in the IT realm.

There are several scripting languages that can be used to send an e-mail when a computer comes online - or better yet, automate the remote installation and let your script do the remote install once a user brings the computer(s) of interest online. The script can also let the user postpone the install if need be.

AutoIt - AutoItScript
AutoIt is a scripting language originally created to automate the installation of software. I've used it to remotely install software on dozens of computers. It has a ping feature that I use every day to reset my cell phone tether software if the ping times get too bad.

AutoHotkey
The AutoIt developers had some disagreements and AutoHotKey was born. Both scripting tools will do what you want - or pick another scripting tool.

If you decide to dive into this area, I would suggest AutoIt and this book:
Windows Admin Scripting Little Black Book, 2nd Edition*-*O'Reilly Media

If you want to see what AutoIt looks like in action - see the video in this post. The problem that the script is attempting to solve = the user's computer had some issue that made explorer crash and when it did, he had to manually end MagicDisc and manually restart MagicDisc in order to get the tray icon back. In the video, you'll see me manually kill explorer to simulate explorer crashing.

The script "sees" that the explorer process has ended
it then restarts explorer
kills MagicDisc
restarts MagicDisc
The kill/restart of MagicDisc is so fast that you never see it leave the list of programs in Task Manager - but you can see that MagicDics is running under a new process ID - so, it did indeed restart. :-)

I'm not a pro at scripting - so there is definitely room for improvement in the code shown in that post.

Combine most any scripting tool what a command line e-mail program like Blat (happy mailing : Blat online) and you have the tool that you asked for. There are probably newer tools than Blat, but I've had no reason to go hunting for another such tool.

In other words, the scripting software does the pinging and when it "sees" that a computer is online, it calls BLAT to send you an e-mail. All of this can be done without any windows showing up on your desktop - or you might add a balloon in the notification area.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
Back
Top