Solved

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

Posted on 2014-04-03
9
719 Views
Last Modified: 2014-04-04
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).
0
Comment
Question by:Mike Caldwell
  • 5
  • 4
9 Comments
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 39977072
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?
0
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 39977076
It's probably in your system32 folder.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 39977094
Note there is a mix of machines.

Remote:  Vista Ultimate.  msg.exe = yes

Local:  Windows 7-64 Home Premium.  msg.exe = no
0
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 39978771
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?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:Mike Caldwell
ID: 39979103
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.
0
 
LVL 9

Accepted Solution

by:
Christopher Jay Wolff earned 500 total points
ID: 39979211
I understand.

While you typing I realized I had been sleeping during my earlier posts.  I am fairly sure you don't need msg.exe on the target machine.  So having it on Vista and not on W7 64 is fine for your notices.  Where my brain was I don't know, maybe someone else borrowed it.

When you've time, should set W7 target machine to accept messages.  Log as admin, go to System control panel, (not sure how your W7 appears to you) find advanced settings which should give a box with tabs across the top I believe.  Select the "Remote" tab and check the box for "allow remote assistance connections to this computer" or such.  While there, please note in the same control panel what is assigned as the full computer name for that W7 station.  Then close that control panel and open the network control panel and turn on network discovery.  

Then launch Regedit and go to the key...
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TerminalServer
then double-click in the right pane on "AllowRemoteRPC" and change from 0 to 1, ok and close regedit.

Then go to Vista, do the same as above with turn on network discovery, then launch elevated command prompt and type
msg<Enter>
just to see if it will put the syntax rules on the screen.

If it does, then type
msg * Hello W7
and see if it shows on the W7 machine.  Then come and tell us how it went.  We may have to use different syntax with your Computer name, but the * should send to all, which just happens to be only one right now.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 39979263
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
0
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 39979371
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.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 39979445
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.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now