Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

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: ,
Posted: Thursday, November 22, 2007 3:00 AM by saraford

Comments

David said:

How can you use this to show a directory listing?

# November 22, 2007 10:29 AM

David said:

Ahh, ok. quick google reveals

> Shell /commandwindow /outputwindow /dir:C:\windows cmd.exe /k dir *.exe /b

# November 22, 2007 10:31 AM

David said:

I'm just talking to myself now:

this is even better:

> shell /commandwindow /outputwindow /dir:C:\windows cmd.exe /c dir *.exe /b

# November 22, 2007 10:32 AM

Y@n said:

Hi,

Great Blog, I like your posts,

I'm currently creating my own blog,

When I've finished i will send you the link

# November 22, 2007 6:06 PM

Секреты Visual Studio said:

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

# February 19, 2009 4:43 AM
New Comments to this post are disabled
Page view tracker