Jump to content

Shell Command: Difference between revisions

From LabVIEW Wiki
mNo edit summary
No edit summary
 
Line 10: Line 10:
[/code]
[/code]
will open ''document.txt'' with Notepad (Windows default).
will open ''document.txt'' with Notepad (Windows default).
[[category:external code]]

Latest revision as of 09:37, 8 October 2007

The exec VI function can be used to send shell commands. Include the shell call with the commands that are desired. Under Windows 2K/XP/Vista operating systems the call is to cmd.exe. For example, the string to copy filea to a drive would be [code] cmd /C "copy filea a:" [/code] with the arguments enclosed in quotes. The exact shell call will depend on the operating system. For Windows 98/ME it is command.com.

To open a document with its associated application, use the start command. [code] cmd /C "start "" "c:\document.txt" [/code] will open document.txt with Notepad (Windows default).