We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Page Bookmarked

AR# 59520

Vivado Tcl - The exec Tcl command does not run built-in Windows System commands such as dir and echo


When issuing commands like "exec dir" or an "exec echo Hello World", the following error occurs:

couldn't execute "dir": no such file or directory

couldn't execute "echo": no such file or directory


When attempting to execute an application, exec first searches for the name as it was specified. 

Then, in order, .com, .exe, and .bat are appended to the end of the specified name and it searches for the longer name. 

The user should ensure that the command "executable" being executed is in the system PATH, or provide the complete path to the executable within the exec command.

In Windows, in order to execute the shell built-in commands like dir and copy, the caller must prepend ``cmd.exe /c '' to the desired command.

For example:

exec cmd /c dir
exec cmd /c (dir c:\\Xilinx)
exec cmd /c (echo Hello World)

Optionally, in the Vivado Tcl console, a user might issue the dir and echo commands by themselves without the exec command as a precursor.

When the Vivado Tcl shell does not recognize these commands, it will automatically pass them to the OS shell.

AR# 59520
Date 01/18/2017
Status Active
Type General Article
  • Vivado Design Suite - 2013.4