3

How can you pop up a message or run a program on remote computer so the currently logged on user can see it.

We have done this on WinXP, but these don't work with Win7.

at.exe \\computername time /interactive message.vbs

(time is hh:mm at least a minute in the future)

psexec.exe \\computername -I message.vbs

To test it you could replace message.vbs with Notepad.exe

Patrick
  • 399
  • 3
  • 4
  • 14

6 Answers6

6

Netsend messages have been removed from Windows 7.

One way I have found to do this without installing 3rd party software is to leverage the remote shutdown commands:

shutdown -m \\computername -r -f -c "MESSAGE" -t 120
shutdown -m \\computername -a

The first command pops a message up, and will begin the shutdown in 120 seconds, the second command will cancel the remote shutdown (-a).

Test this on something that does not matter first!

boburob
  • 1,174
  • 8
  • 23
  • This does help with the desire to pop up a message. In windows 7 it pops up a small yellow box on the bottom right off the systems tray and goes away after a few seconds. In XP however its a nice big pop up message that wouldn't be missed. I was hoping to also to see if I was able to launch a program remotely that would appear for the remote user. Thanks for the help! – Patrick Aug 22 '12 at 19:26
  • Thank's that helps on few windows 7 boxes, however, it is not working for me. – Net Runner Nov 21 '17 at 19:15
3

by vbscript:

dim WMIObj, strHost, intProcessID

on error resume next

strHost = "remotehost.domain.com"

set WMIObj = GetObject("winmgmts:\\" & strHost & "\root\cimv2:Win32_Process")
if IsObject(WMIObj) then
    WMIObj.Create "cmd.exe /C msg * ""ha-ha-ha""", null, null, intProcessID
end if

set WMIObj = nothing
Vadim
  • 31
  • 1
3

This should be doable with the msg. Something like

msg <username> /SERVER:<servername> <message

Cian
  • 5,777
  • 1
  • 27
  • 40
Ahmad
  • 31
  • 1
2

The following command works with XP and 7 initiated from 2003 server:

at \\remotecomputer time /interactive msg remoteuser /SERVER:remotecomputer This is the message

The remotecomputer is the computer where the message should appear and the remoteuser is the user logged into the remote computer (user who should see the message).

To clear all at commands on the remote computer use:

at \\remotecomputer /delete /yes

Use this before the "message" at.

Flup
  • 7,688
  • 1
  • 31
  • 43
2

For the xp users at.exe \computername time /interactive message.vbs

when on windows 7, try SCHTASKS /Create /SC DAILY /TN my1stschtask /TR message.vbs /ST hh:mm:ss /SD dd/mm/yyyy

where my1stschtask is any scheduled task name (referenced when need to delete the task) like AT number id to delete task need a reference

In dos command line, schtasks /? to search out the relevant info

comgreen
  • 21
  • 1
-1
setlocal EnableDelayedExpansion


set msg1=This is a message from Information Services. Please contact IT Support on nnnnn as soon as possible to resolve a Windows Update issue on this machine, quoting Reference Fnnnnnnn. Thank you


msg /SERVER:[Computer Host name] */TIME:300 %msg1

%
ThoriumBR
  • 5,272
  • 2
  • 23
  • 34