How to open up a DOS window?

Posted by Purbam on Mon 26 Jan 2015 09:51 AM — 5 posts, 23,084 views.

#0
I am trying to pop up a DOS window to mimic #mess function in zMUD.
It works well in LUA, with os.execute("echo something &pause"). But in Perl, either system() or exec() doesn't work.
If I use system(), the child process is created, but it doesn't pop-up the DOS window and therefore halts mushclient.
If I use exec(), the DOS window pops-up as expected, but mushclient exits when the DOS windows is closed, because exec() in Perl replaces the original process.
I also tried fork(), but unfortunately it is not supported in Perlscript on Windows.

Any suggestions?

Or, is there an easier way to mimic zMud's #mess function? What exactly I need is a window (or dialog box or whatever) to be pop-up to the top of my desktop when mushclient is minimized.

Thanks in advance!
Australia Forum Administrator #1
I don't know what zMud's #mess does exactly, but this might do it for you:


  assert (utils.shellexecute ("cmd", "/C dir"))


Replace "dir" with "something" and see how you go.
#2
Nick Gammon said:

I don't know what zMud's #mess does exactly, but this might do it for you:


  assert (utils.shellexecute ("cmd", "/C dir"))


Replace "dir" with "something" and see how you go.


Thanks a lot for the prompt reply!
If I understand correctly, the utils.* functions work in Lua only. But now I am using Perlscript as the script language. Can it also be used in Perl?

#mess in zMud is something like utils.msgbox. The different is, it can pop-up whatever the mud window is on the top or not.
Australia Forum Administrator #3
No it can't be used in Perl (doesn't Perl have something similar?).

You can always make a small Lua plugin, whose life is dedicated to simply putting up the message box and communicate with this plugin.
#4
Yes, Perl do have some functions for system calls. But as I mentioned in my original post, they don't work well in mushclient.

Making a LUA plugin is a good idea, I will have a try. Thanks!