Solved

Working with executables.

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Modal Popup Extender control 1 35
JSON  parse help 7 40
parsing JSON help 1 20
Open a link in vb.net 2 15
Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

791 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