Replacing an executable file, programatically.....
-
Hi guys, I've written a simple C# console application is VS.NET 2005 and now I want that as soon as the user clicks on the exe file, the location of the exe file, no matter wherever it is, is shifted to 'D:/Folder/'. It is noteworthy, that I dont want replication, just replacement of the original exe file from its source location, to that location programmed. Therefore, can anyone help me with that little piece of code, using which I can replace my console app. from its current location to another location programatically allocated on the system? Your help will be appreciated, Rajdeep.NET :doh:
-
Hi guys, I've written a simple C# console application is VS.NET 2005 and now I want that as soon as the user clicks on the exe file, the location of the exe file, no matter wherever it is, is shifted to 'D:/Folder/'. It is noteworthy, that I dont want replication, just replacement of the original exe file from its source location, to that location programmed. Therefore, can anyone help me with that little piece of code, using which I can replace my console app. from its current location to another location programatically allocated on the system? Your help will be appreciated, Rajdeep.NET :doh:
-
Well, I wonder if this helps you http://msdn.microsoft.com/en-us/library/system.io.fileinfo.moveto.aspx[^] :)
-
Hi guys, I've written a simple C# console application is VS.NET 2005 and now I want that as soon as the user clicks on the exe file, the location of the exe file, no matter wherever it is, is shifted to 'D:/Folder/'. It is noteworthy, that I dont want replication, just replacement of the original exe file from its source location, to that location programmed. Therefore, can anyone help me with that little piece of code, using which I can replace my console app. from its current location to another location programatically allocated on the system? Your help will be appreciated, Rajdeep.NET :doh:
-
thanx! U see, nobody helps me in CodeProject! I dont know why. They say I post wrong answers! But thats no problem. I give right answers or wrong or whatever, but atleast, I am answering. :sigh:
-
Hi guys, I've written a simple C# console application is VS.NET 2005 and now I want that as soon as the user clicks on the exe file, the location of the exe file, no matter wherever it is, is shifted to 'D:/Folder/'. It is noteworthy, that I dont want replication, just replacement of the original exe file from its source location, to that location programmed. Therefore, can anyone help me with that little piece of code, using which I can replace my console app. from its current location to another location programatically allocated on the system? Your help will be appreciated, Rajdeep.NET :doh:
Hello Rajdeep, It is possible.You should copy your exe to another location and then pass the aregument to that exe to delete first.
mailto: anubhava.prodata@gmail.com
-
Hi guys, I've written a simple C# console application is VS.NET 2005 and now I want that as soon as the user clicks on the exe file, the location of the exe file, no matter wherever it is, is shifted to 'D:/Folder/'. It is noteworthy, that I dont want replication, just replacement of the original exe file from its source location, to that location programmed. Therefore, can anyone help me with that little piece of code, using which I can replace my console app. from its current location to another location programatically allocated on the system? Your help will be appreciated, Rajdeep.NET :doh:
I can probably think that you are trying to make some malicious applications.... Anyway! Here we go... Long time back i read this article.... Load an EXE File and Run It from Memory[^] Here goes the hypothesis of Julien: Load the exe file and inside the exe, write a file delete or move operation. After this, you may quit the exe which may get what you required.... Never tried this... but you may give a try and send me a feedback..... Jai Ho........
Have a Happy Coding.....