I run the application its copying the exe file with another name to another location i want now that if i run the exe from the other location it will do another things and not the same things it did in the first time. Like in the project to make that the
second exe file will use and do things from another code in the same project.
public partial class Form1 : Form
applicationFileName = Path.GetDirectoryName(Application.ExecutablePath + "\\test.exe");
hardDrivedInfo = System.IO.Directory.GetLogicalDrives();
foreach (string str in hardDrivedInfo)
MessageBox.Show("Oops something went wrong sorry");
private void Form1_Load(object sender, EventArgs e)
So now in D: i have abcdefg.exe and i want it to make something else when i run it. How can i do it ?
You could do it via command line args. When you run the executable in the new location pass along some additional command line parameter, and then when the program is started, if you see that the command line parameter exists, do something different.
Marked as answer bychocoladeTuesday, May 29, 2012 5:10 PM