1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Batch "msg" works across a domain?

Discussion in 'Software Development' started by Callum_Dawson, Apr 25, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. Callum_Dawson

    Callum_Dawson Thread Starter

    Joined:
    Mar 9, 2009
    Messages:
    560
    I've made a notice script for my domain, so if needs be, I can send a message to a certain user(s). But when testing, it only works for local users, it won't work across the domain. Is there any option for "msg" or method to make it work on other computers (even if I must input the computer name). The very simple script is below;

    Code:
    @echo off
    echo -------------------------------
    echo ------Domain Notice Tool-------
    echo -------------------------------
    set /p user=Username: 
    set /p message=Message: 
    msg %user% /v /w %message%
    pause
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    Have yet to play around with msg.exe but it looks like you need to use the server name they are logged on to.
     
  3. Callum_Dawson

    Callum_Dawson Thread Starter

    Joined:
    Mar 9, 2009
    Messages:
    560
    I added "set /p c=Computer: " and "/SERVER:%c%" to the script, but it just says "Error 5 getting session names." Now I've just tried it from the client to the server and it works perfectly. So why can't the server send messeges to the client(s)?
     
  4. helpful

    helpful

    Joined:
    Sep 17, 2009
    Messages:
    697
  5. helpful

    helpful

    Joined:
    Sep 17, 2009
    Messages:
    697
  6. Callum_Dawson

    Callum_Dawson Thread Starter

    Joined:
    Mar 9, 2009
    Messages:
    560
    @helpful: Yea, that's for XP, I use Windows 7 and Windows Server 2008.
     
  7. Callum_Dawson

    Callum_Dawson Thread Starter

    Joined:
    Mar 9, 2009
    Messages:
    560
    I looked into PsExec, it's exactly what I need, just it doesn't function correctly... I remotely executed a batch script where it asks for the message, it executed, exept the variable only saved the first character I entered.
     
  8. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    On the clients you have to make a registry change to allow the incoming connection:

    Click Start | Run (or press WinKey+R), type regedit, press Enter
    Navigate to here:
    Code:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
    Change the AllowRemoteRPC item from 0 to 1 (If not present, add it)
    You'll have to reboot for it to take effect.

    You can use this .reg file in a logon script:
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
    "AllowRemoteRPC"=dword:00000001
    It may not take effect until the next boot though
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/919173

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice