Bad File Handle Using printf Function in LabWindows™/CVI™

Updated May 3, 2018

Reported In


  • LabWindows/CVI

Operating System

  • Windows

Issue Details

When I call the printf function in my code in LabWindows™/CVI™, I get a runtime error referencing a "bad file handle". How can I call printf?


This can happen if you do not have access to the Windows standard console window. Ensure you have permission and the ability to open up the standard Windows console/command line. 

If you do not have the ability to access this and want to use printf for debugging purposes, you can utilize LabWindows CVI's Debug Output window instead. You can open up the Debug Output window by selecting Window >> Debug Output​. Instead of using the printf function, use the DebugPrintf function.


Not Helpful