hi all,
i m trying with DOS commands. the command 'msg' works very well in windows xp. but when i tried the same in windows 7 home basic, it gives an error. can anybody please tell me why does this happens? is there any alternative command for it? or how can we display a msgbox in windows 7?

Recommended Answers

All 5 Replies

msg is not compatible command with win7 home basic,you would need to upgrade your win7 version to use that command ,your other alternative would be to use a messenger program like windows messenger

Copy the following code into a file named msgbox.vbs. Display a message from the
command prompt by:

C:\> msgbox "my message"
C:\> msgbox "my message" "my title"

If you want multiple lines then include \n as in

C:\> msgbox "this\nhas\nfour\nlines" "My Message Box"

set arg = Wscript.Arguments

select case arg.Count
    case 0
        Wscript.Echo ""
        Wscript.Echo "Display a message box with the given text and (optional) title"
        Wscript.Echo "\n in text will skip to a new line"
        Wscript.Echo ""
        Wscript.Echo "Usage:"
        Wscript.Echo ""
        Wscript.Echo "    msgbox text [title]"
        Wscript.Echo ""
        Wscript.Quit
    case 1
        prompt = arg(0)
        title  = "Message Box"
    case 2
        prompt = arg(0)
        title  = arg(1)
end select

prompt = Replace(prompt,"\n",vbCrLf)

msgbox prompt,vbOKOnly,title

To send a message to another user on the network you could try the "net send" command although I do not know if this available in your version of Windows.

commented: offset negative rep +5

if you want to use msg in dos command make sure that the both messenger in services is enable..

if you want to use msg in dos command make sure that the both messenger in services is enable..

there is no msg cmd in basic win7

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.