Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>This seems be easily done in C#</p> <p>A 3rd party app (Winsent's Sent utility - winsentmessenger.com/sent) apparently can do this.</p> </blockquote> <p><a href="http://www.winsentmessenger.com/netsend/" rel="nofollow">http://www.winsentmessenger.com/netsend/</a></p> <p>The application in question is simply a wrapper around net send.</p> <p>You could do the same, and invoke the process directly.</p> <p>A solution lifted from: <a href="http://members.iinet.net.au/~alw1746/awhome/freeware/WinPopup_java.txt" rel="nofollow">http://members.iinet.net.au/~alw1746/awhome/freeware/WinPopup_java.txt</a></p> <pre><code>/* WinPopup: send message to PC(s) on a Windows network from a Java program (like winpopup or net send). Usage: java WinPopup "user1,user2,..." "message" eg. java WinPopup "peter" "where are you?" or java WinPopup 192.168.14.20 "Hello" Build: javac WinPopup.java Alex Wong, Feb 2001 */ import java.util.*; import java.text.*; import java.io.*; public class WinPopup { public static void main(String args[]) throws Exception { String status; if (args.length &lt; 2) { System.out.println("Usage: java WinPopup \"user1,user2,...\" \"msg\""); System.exit(1); } if (args[0].length() &lt; 1) { System.out.println("User not found"); System.exit(1); } if (args[1].length() &lt; 1) { System.out.println("Message not found"); System.exit(1); } WinPopup popup=new WinPopup(); status=popup.alert(args[0],args[1]); if (!status.equals("OK")) System.out.println(status); } public String alert(String users,String msg) { //loop thru list of users and net send the msg. String buf,userList,user; StringBuffer popup; int ulen; try { if (users.length() &lt; 1) throw new Exception("User list not found."); if (msg.length() &lt; 1) throw new Exception("Message not found."); popup=new StringBuffer(); StringTokenizer st=new StringTokenizer(users,","); while (st.hasMoreTokens()) { buf=st.nextToken(); popup.append(buf).append(","); } if (popup.length() &gt; 0) { popup=popup.deleteCharAt(popup.length()-1); userList=popup.toString(); ulen=userList.length(); for (int start=0,fin=0; fin &lt;= ulen; fin++) { if ((fin==ulen &amp;&amp; fin &gt; start) || userList.charAt(fin)==',') { user=userList.substring(start,fin); dosCmd("net send "+user+" \""+msg+"\""); fin++; start=fin; } } } return "OK"; } catch (Exception e) { return e.toString(); } } public void dosCmd(String cmd) { //spawns a DOS process to run the net send command. java.lang.Runtime rt; Process proc; try { rt=java.lang.Runtime.getRuntime(); proc=rt.exec("c:\\winnt\\system32\\cmd.exe /C "+cmd); StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR"); StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT"); errorGobbler.start(); outputGobbler.start(); int exitVal=proc.waitFor(); } catch (Exception e1) { System.out.println("dosCmd exception."); System.out.println(e1.toString()); } } class StreamGobbler extends Thread { //eat all stderr and stdout output. InputStream is; String type; StreamGobbler(InputStream is, String type) { this.is = is; this.type = type; } public void run() { try { InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line=null; while ( (line = br.readLine()) != null) ; } catch (IOException ioe) { ioe.printStackTrace(); } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload