Solved

Working with executables.

Posted on 2008-06-10
4
210 Views
Last Modified: 2013-12-17
Is it possible in .net visual C# to copy and program.exe file from a remote source to the local pc and execute the program with command line switches?
0
Comment
Question by:edrosie
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Rob Siklos
ID: 21753252
Sure, what's the remote source?  Network share? FTP? HTTP?
0
 

Author Comment

by:edrosie
ID: 21753268
Network Share

0
 
LVL 9

Accepted Solution

by:
Rob Siklos earned 500 total points
ID: 21753532
To copy the file:

   File.Copy(@"\\machinename\c$\myapp.exe", @"c:\myapp.exe");

To execute the file:

   
Process myProcess = new Process();

myProcess.StartInfo.FileName = @"c:\myapp.exe";

myProcess.StartInfo.CreateNoWindow = true;

myProcess.StartInfo.Arguments = "/c /b /f=test";

myProcess.StartInfo.UseShellExecute = false;

myProcess.Start();

Open in new window

0
 

Author Closing Comment

by:edrosie
ID: 31465842
Thank you very much
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now