LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem: Using "msg" command with "System Exec.vi"

Solved!
Go to solution

From running the LabView Code:

 

'C:\Windows\System32\msg.exe' is not recognized as an internal or external command,
operable program or batch file.

 

Using the above as the block diagram.

 


 

From the command prompt:

 

msg /server:localhost * test 

 

 

Fires up a window without any issue.

 

And yes, the behavior seemed extremely bizarre to me as well. I've also tried having LabView run a batch file instead, only to have the same results.

 

- Mike
~~~~~~~~~~~~~~
Current Setup:
LabView 2010
Windows 7
0 Kudos
Message 11 of 19
(11,278 Views)

Hi Mike,

 

I'm working with Kyle on this issue and had a couple of other steps to try out:

 

1) Try "C:\Windows\System32\msg.exe /server:localhost * test" - basically, without the cmd /c.

 

2) Have you seen this on any other computers?  We've tried a couple of PC's here and haven't been able to reproduce it.

 

Thanks,

Morgan S

Applications Engineer

National Instruments

0 Kudos
Message 12 of 19
(11,262 Views)

1.) This command actually returns the following through LabView's error system:

 

Error 2 occurred at System Exec.vi. Command was "C:\Windows\System32\msg.exe /server:localhost * test"

Possible reason(s):

LabVIEW:  Memory is full.
=========================
NI-488:  No Listeners on the GPIB.

 2.) I do have one other development machine I can try to run this on, but not until Monday. I'll make an attempt to run it then.

 

- Mike
~~~~~~~~~~~~~~
Current Setup:
LabView 2010
Windows 7
0 Kudos
Message 13 of 19
(11,259 Views)

Mike,

 

The times I have gotten this with a valid command, I have added quotes around the command.  So in this case:

 

cmd /c "msg /server:localhost * test"

 

I can't get reproduce your problem, either, but have had the similar issue in the past and the quotes have thus far always solved the problem.

0 Kudos
Message 14 of 19
(11,249 Views)

Well, give the quotes a shot and had no luck.

 

 

Still returns the same error message.

 


 

I was able to attempt to run this command on a co-worker's computer today. Same error on his machine.

 

I did another test today; I found out that another "Terminal Services" command, 'tsprof' also cannot be found. So I'm starting to think there's an underlying issue here with LabView talking to any type of Terminal Services.

The question is why? Windows still lets me run these commands with no problems.

 

 

- Mike
~~~~~~~~~~~~~~
Current Setup:
LabView 2010
Windows 7
0 Kudos
Message 15 of 19
(11,233 Views)

Hi Mike,

 

When you say that you received the same error on your co-worker's machine, was it the LabVIEW Error 2 or the previous error?

 

Give this block a try and see if it works for you:

 

System Exec msg.png

 

Have a great day,

 

Chris

Applications Engineer
National Instruments
0 Kudos
Message 16 of 19
(11,223 Views)

On the co-workers machine, the "standard error" indicator returned an error:

 

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

Which is one of the two errors I'll receive.

 

 


 

 

The above code gives the error code 2.

With source =

 

System Exec.vi. Command was "msg.exe /server:localhost * test"

 

 

 

- Mike
~~~~~~~~~~~~~~
Current Setup:
LabView 2010
Windows 7
0 Kudos
Message 17 of 19
(11,204 Views)
Solution
Accepted by topic author Mike_in_Maryland

Hi ATE_Mike,

 

I believe I've figured out what's going on here.  Is your Windows 7 installation 64-bit?

 

If so there are issues with the System Exec.vi calling msg.exe on a 64-bit operating system since msg.exe is still a 32-bit application. It has to do with Windows 32-bit applications on a 64-bit system calling other 32-bit applications.  If you'd like to learn more about it, check out these links:

http://msdn.microsoft.com/en-us/library/aa384203(v=VS.85).aspx

http://msdn.microsoft.com/en-us/library/aa384249(VS.85).aspx

 

The short story is that you need to give the System Exec this command:

 

C:\Windows\Sysnative\msg.exe /server:localhost * test

 

Give this a try and let me know!

 

Have a great day,

 

Chris

Applications Engineer
National Instruments
0 Kudos
Message 18 of 19
(11,192 Views)

It worked! I completely forgot I was working in Windows 7 x64. Have to remember to mention that next time.

 

For those interested, a snippet from the Windows website:

Interprocess Communication Between 32-bit and 64-bit Applications

 

A 64-bit executable file located under %windir%\System32 cannot be launched from a 32-bit process, because the file system redirector redirects the path to %windir%\SysWOW64. Do not disable redirection to accomplish this; use %windir%\Sysnative instead.

 I was running 32-bit LabView 2010 on a Windows 7 x64 machine. I ended up looking in the "SysWOW64" directory for the 'msg.exe' today and naturally, the file does not exist.

So it looks like Windows was automatically redirecting the file request to an area it wasn't supposed to.

Tricky.

 

 

Thanks for the help guys!

- Mike
~~~~~~~~~~~~~~
Current Setup:
LabView 2010
Windows 7
Message 19 of 19
(11,182 Views)