Home > Ask the Microsoft .Net Development Experts > C# Development Questions & Answers > How do I write the following lines of code in C#?
Ask The Win Development Expert: Questions & Answers
EMAIL THIS

How do I write the following lines of code in C#?

Mark Belles EXPERT RESPONSE FROM: Mark Belles

Pose a Question
Other Win Development Categories
Meet all Win Development Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 30 August 2004
How do I write the following lines of code in C#?
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run("cmd.exe")


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
C#
Top C# expert advice
Escape from mailto:
Can I run a .NET app without installing .NET runtime?
Opening a link with parameters to a new window
Is it possible to open a child form in modal type?
Painting in the non-client area
Global cases to the entire application
Validating the textbox entry for date format
Book on network programming with C#
Calling a secondary UserControl applet

C# programming language
Inside Visual Studio 2010
Mono 2.0 moves .NET apps to Linux - includes migration analyzer
LINQ beyond queries: Strong-typed refection
Assembly versioning in the .NET Framework 2.0
Book excerpt: Creating graphical output using the .NET Compact Framework
Visual Studio 2008 Learning Guide: C# 3.0
Simonyi firm to address divide between domain experts and developers
On Extension Methods in C# and .NET Framework 3.5
Generate RSA public and private keys, export to XML
Book excerpt: Upgrading to Visual Studio 2005

C# Development
Top C# expert advice
Using LoadRunner for testing in .NET
Take care with InitializeComponent
GroupBox inheritance
Escape from mailto:
Windows Forms: Overriding the OnClosing method
Passing data between forms
Can I run a .NET app without installing .NET runtime?
Opening a link with parameters to a new window
Is it possible to open a child form in modal type?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
C#  (SearchWinDevelopment.com)
GLib  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


If you are simply interested in launching applications using C#, look into the Process.Start() method in the Diagnostics namespace. I am not able to determine the scope of your application by the question presented, but I get the feeling you are trying to do this from a web page. If you are trying to launch programs from a web page then you could either continue to use scripting (VBScript, JScript, or WScript) to implement the desired actions. Or you could write an ActiveX object (COM) or .NET object that could be embedded in a page and downloaded to the client and run locally. You need to be carefull when running programs on the client side of the security settings in place on the client. Local internet security settings may be cranked up to deny such requests.

If this is a windows application (client and server) then you could use Sockets to create a simple client and server protocol that would allow you to send commands back and forth and execute any processing you need to launch programs or open files. This of course would be a much more complicated scenario requiring more developement time and research.

Feel free to contact me with more details reqarding your specific problem, using this link.




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Windows Development - White Papers, News and Expert Advice
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts