Solved

Working with executables.

Posted on 2008-06-10
4
213 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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