Working with executables.

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?
edrosieAsked:
Who is Participating?
 
Rob SiklosConnect With a Mentor Commented:
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
 
Rob SiklosCommented:
Sure, what's the remote source?  Network share? FTP? HTTP?
0
 
edrosieAuthor Commented:
Network Share

0
 
edrosieAuthor Commented:
Thank you very much
0
All Courses

From novice to tech pro — start learning today.