Freigeben über


Did you know... How to run external executables from the VS command line? - #089

The command Tools.Shell will run an external executable out of process from VS.  To run, it is basically

Shell <executable>

But of course, we got optional arguments…

Shell [/commandwindow] [/dir:folder] [/outputwindow] <executable> [/args]

/commandwindow (or /c) – to display the executable’s output in the command window

/outputwindow (or /o) – to display the executable’s output in the output window

/dir:folder – specifics the working directory

For example,

Shell /o /c xcopy.exe c:\users\saraf\documents\cmdwinlog.txt c:\users\saraf\pictures

will display the xcopy output in the output window.

output redirected to the output window

And what can I say… (you knew it was coming!)… Happy Thanksgiving!

Happy Turkey Day!

with special thanks to this site for helping me remember how to draw a turkey.

Technorati tags: VS2005Tip, VS2008Tip

Comments

  • Anonymous
    November 21, 2007
    PingBack from http://msdnrss.thecoderblogs.com/2007/11/22/

  • Anonymous
    November 22, 2007
    How can you use this to show a directory listing?

  • Anonymous
    November 22, 2007
    Ahh, ok. quick google reveals > Shell /commandwindow /outputwindow /dir:C:windows cmd.exe /k dir *.exe /b

  • Anonymous
    November 22, 2007
    I'm just talking to myself now: this is even better: > shell /commandwindow /outputwindow /dir:C:windows cmd.exe /c dir *.exe /b

  • Anonymous
    November 22, 2007
    Hi, Great Blog, I like your posts, I'm currently creating my own blog, When I've finished i will send you the link

  • Anonymous
    February 18, 2009
    Команда Tools.Shell (Сервис.Оболочка) запускает внешние исполняемые файлы из Visual Studio. Для запуска