Jump to content
  • Advertisement
Sign in to follow this  
Endurion

C#, External Commands

This topic is 2654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on a C64 IDE (C#, C64Studio). Most of the common stuff is down and working nicely. I'm using .NET 2.0 with C#, Visual Studio 2008.

I've hit a snag I'd like to overcome:


I'm trying to implement pre, custom and post build scripts analog Visual Studio. The plan is to have a command script (one or several commands) which need to be processed. If one command fails skip the following commands.


My first attempt was to use System.Diagnostics.Process with cmd.exe, /K as startup arg and feed the commands per StandardInput. That works fine, however I don't notice if any one of the commands fail. I obviously get the result of cmd.exe itself.


If I use every line by itself the basic commands won't work (because they're implemented by cmd.exe, not as standalone files).



How would one go about this? I want the result of every single command and be able to capture output and error streams.


I could try to analyze the commands and if the common "copy" or other commands appear redirect them to cmd.exe, but that sounds rather fragile.

Share this post


Link to post
Share on other sites
Advertisement
Ok, I found a workaround: I'm using the switch /C and call the cmd process for every line in the script.


Not really elegant but seems to do the trick. If anybody knows a cleaner way I'd be happy to hear about it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!