"msg" command runs from CmdPrompt but not from batch script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
pstein
Posts: 123
Joined: 09 Nov 2011 01:42

"msg" command runs from CmdPrompt but not from batch script

#1 Post by pstein » 23 Feb 2021 23:02

When I enter the command

msg Peter /TIME:0 hello

on command line CmdPrompt then everything is ok.

A popup info box appears with the message "hello".

When I execute the same command from inside a DOS batch script then I got an error:

'msg' is not recognized as an internal or external command,
operable program or batch file.

Why?

Squashman
Expert
Posts: 4268
Joined: 23 Dec 2011 13:59

Re: "msg" command runs from CmdPrompt but not from batch script

#2 Post by Squashman » 24 Feb 2021 01:17

I cannot reproduce your problem.

dbenham
Expert
Posts: 2449
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: "msg" command runs from CmdPrompt but not from batch script

#3 Post by dbenham » 24 Feb 2021 15:09

Perhaps your batch script is corrupting your PATH variable?

Eureka!
Posts: 123
Joined: 25 Jul 2019 18:25

Re: "msg" command runs from CmdPrompt but not from batch script

#4 Post by Eureka! » 25 Feb 2021 03:57

.. or your PATHEXT variable

Post Reply