Good day to all!
It has been a long while since writing code and must admit I have gotten somewhat rusty. I am hoping I am just making a dumb mistake that will easily be seen and corrected here. I am trying to call the "msg.exe" program from the c:\windows\system32 directory and pass it some paramaters that are generated from a user filling in a dialog. For some reason, I get an error 1932 on every type of Run/RunShell/ExecuteShell etc. that I try which happens to be an error that does not give a lot of helpful information.
I also tried generating a "cmd" file and then running that file but get an error that the program I am trying to run is not recognized as an internal or external command, operable program or batch file which I think means I am not finding the executable for some reason. Below is the section of code with the different options I have tried. Any help would be appreciated.
:Sys_MSG
Debug(@ON)
CmdFile = FileOpen("c:\wrapper\msgcmd.cmd", "Write")
FileWrite(CmdFile, "@echo on")
FileWrite(CmdFile, "c:\windows\system32\msg.exe /SERVER:%systemname% * /TIME:15 %messagetext%")
FileWrite(CmdFile, "Pause")
FileWrite(CmdFile, "Exit")
FileClose(CmdFile)
ShellExecute("msgcmd.cmd", "", "c:\wrapper", @NORMAL, "")
;Run("c:\windows\system32\msg.exe", "?")
;params = "/SERVER:%systemname% * /TIME:15 %messagetext%"
;RunShell("msg.exe", params, "c:\windows\system32", @NORMAL, @NOWAIT)
;Run("c:\windows\system32\msg.exe", "/SERVER:%systemname% * /TIME:15 %messagetext%")
;RunShell("msg.exe", "/SERVER:%systemname% * /TIME:15 %messagetext%", "c:\windows\system32", @HIDDEN, @NOWAIT)
;ShellExecute("msg.exe", "/SERVER:%systemname% * /TIME:15 %messagetext%", "", @HIDDEN, "")
Debug(@OFF)
Return