Link to home
Start Free TrialLog in
Avatar of Mike Caldwell
Mike CaldwellFlag for United States of America

asked on

VBScript to send a message from a Vista machine to a Windows 7 machine

I have a remote PC which runs 24/7 processing certain data.  If it throws an error, I need to know right away.  Mr. Google reports that the various {net send} utilities in earlier OSes were apparently too convenient, so have been eliminated.  So I need a script for sending a message from the remote Vista machine to the local Windows 7 machine.  Email is not a good solution.

Both machines are on the same LAN (home).
Avatar of Christopher Jay Wolff
Christopher Jay Wolff
Flag of United States of America image

Do you have the windows Msg.exe on your systems?  Some report it only works with Pro and Business versions.

Here is what Microsoft says about msg.exe at TechNet...
http://technet.microsoft.com/en-US/library/cc771903.aspx

This explanation is a little quicker read with helpful tips, and some alternative software, and says msg.exe is only for pro and business...
http://www.cezeo.com/tips-and-tricks/msg-command/

Could you check on the OS and existence of msg.exe on your systems and let us know?
It's probably in your system32 folder.
Avatar of Mike Caldwell

ASKER

Note there is a mix of machines.

Remote:  Vista Ultimate.  msg.exe = yes

Local:  Windows 7-64 Home Premium.  msg.exe = no
This would be my plan for using msg.exe in your requested script.

Reportedly Windows 7 Ultimate, Professional, Business, and Enterprise all have msg.exe, so you could simply upgrade to get msg.exe installed on your W7.  There is supposed to be an upgrade installation option for leaving your data and settings and personal files intact.  As long as your spending time and money you may want W8.  I hope this is not a concern for you, but if so, some third party network programs that use certain drivers may no longer function after upgrading from one W7 to another version of W7 as described here
http://support.microsoft.com/kb/968216/en-us

So make sure you will be able to reinstall all your needed programs that you own, after upgrading your W7.  And I recommend using msg.exe rather than good third party software that is available to send your messages, because when you upgrade in the future to new versions of Windows, you are more likely to get msg.exe and it will be less likely you have to change your script.  If you have reasons to prefer third party software rather than using msg.exe just let us know.

1.  Backup you w7 station.

2.  Download and run the Upgrade Advisor from here...
http://www.microsoft.com/en-us/download/details.aspx?id=20

and note issues.  If necessary, get back to EE before proceeding.

3.  Upgrade Windows 7 Home Premium to Ultimate or Business or whatever you like, using the Windows Anytime Upgrade on your current W7HP computer which is described here
http://windows.microsoft.com/en-us/windows7/help/videos/upgrade-to-another-edition-of-windows-7-by-using-windows-anytime-upgrade

4.  If all is in good working order for how things normally exist, backup new installation.

5.  Prove msg.exe exists and functions by opening command prompt and typing...
msg * Hello.<Enter>

If the little box pops up and displays your message to yourself then we can start on your script.  You may have to make a simple edit on the registry, and/or adjust firewall and credential issues but lets find out how you'd like to proceed first.

Will any other machines get involved at a later date?

What do people here think so far?
The expense and bother of upgrading the OS for such a little task seems out of line to me.  I'm sure all my programs would work just fine (but not with a Windows 8 switch; my business is patent law, and my docketing software is known to not be compatible), but I think it more in line with the need to go the way I did not prefer: just send myself an email.  I used to send myself SMSes via email when my phone carrier was ATT, but I now use TMobile and they have announced ending that feature.  Emails are a bit slower, but it sure sounds easier and a lot cheaper (free) to just send an email.
ASKER CERTIFIED SOLUTION
Avatar of Christopher Jay Wolff
Christopher Jay Wolff
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yep!

Next I need to deal with a VB Script to do this, and not so sure whether administrative privildeges will be an issue, but I'll make that a separate posting if I need it.  Thanks for hanging with me Chris.

Mike
You're quite welcome.  Now to figure out why that happened.  Hmmm.  We could be here a while.

Anyway, thank you for the points although I didn't get your script done.  If the above worked I was going to head, with the help of other experts of course, in the direction of error trapping using powershell script.  You can call msg just like you did in the DOS window, from the powershell window or powershell script which is a .ps1 file.

Here is an example of where I was going...
http://www.vexasoft.com/blogs/powershell/7255220-powershell-tutorial-try-catch-finally-and-error-handling-in-powershell

So good luck, and in your EE posting for this you may want to consider for title and tags,  "msg.exe, powershell, vb, networks"

Happy Day.
Not a problem: the error is my own VS Script which detects a wrong condition.  Right now it simply throws up a msgbox and I look from time to time remotely.  So this is to just alert me that I found a problem.  The script turned out to be tres easy:

Set oshell = createobject("wscript.shell")   ' in the header, then later on:

oshell.run "msg " & " * " & " ZIP file error on machine "  & strMachineNbr

BTW, for someone reading this later, note that the message line requires a leading space for each section.  If missing, it goes to the next space.