annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

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

Risolto!
Vai alla soluzione

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
Messaggio 11 di 19
12.014Visualizzazioni

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
Messaggio 12 di 19
11.998Visualizzazioni

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
Messaggio 13 di 19
11.995Visualizzazioni

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
Messaggio 14 di 19
11.985Visualizzazioni

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
Messaggio 15 di 19
11.969Visualizzazioni

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
Messaggio 16 di 19
11.959Visualizzazioni

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
Messaggio 17 di 19
11.940Visualizzazioni
Soluzione
Accettato da 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
Messaggio 18 di 19
11.928Visualizzazioni

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
Messaggio 19 di 19
11.918Visualizzazioni