Figure 1. Error Message
Note: msg.exe may be replaced by another program you are trying to call or the path to your System32 folder may differ.
When I try this same command from a Command Prompt, it works just fine. I am using a 64-bit Windows operating system but 32-bit LabVIEW. What am I doing wrong?
LabVIEW 32-bit runs on the WOW layer in a Windows 64-bit environment and can therefore only access the 32-bit namespace. When the System Exec VI calls cmd.exe, the cmd.exe called is native to the operating system, in this case a 64-bit version. This requires a switch in namespaces between the 64-bit and the 32-bit namespaces. Since the command is being called through a 32-bit LabVIEW application, Windows cannot properly link from the 32-bit application, through the 64-bit system command prompt, and back to the 32-bit executable.
To fix the problem, the input string for the System Exec VI needs to be changed to explicitly reference the Windows\Sysnative folder instead of the Windows\System32 folder.
If this is returning an error or not working:
Figure 2. Fails on 64-bit Windows (VI Snippet)
Use this instead:
Figure 3. Works on 64-bit Windows (VI Snippet)
Note: If you have this problem and try to call the command without the cmd /c in the input string, you will receive a LabVIEW Error 2: Memory is Full.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.