Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Replacing an executable file, programatically.....

Replacing an executable file, programatically.....

Scheduled Pinned Locked Moved C#
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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:

    M S L K 4 Replies Last reply
    0
    • L Lost User

      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:

      M Offline
      M Offline
      MNantu
      wrote on last edited by
      #2

      Well, I wonder if this helps you http://msdn.microsoft.com/en-us/library/system.io.fileinfo.moveto.aspx[^] :)

      L 1 Reply Last reply
      0
      • M MNantu

        Well, I wonder if this helps you http://msdn.microsoft.com/en-us/library/system.io.fileinfo.moveto.aspx[^] :)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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:

        M 1 Reply Last reply
        0
        • L Lost User

          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:

          S Offline
          S Offline
          S a n d y
          wrote on last edited by
          #4

          In which type of application, you can use such type of implementation?

          1 Reply Last reply
          0
          • L Lost User

            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:

            M Offline
            M Offline
            MNantu
            wrote on last edited by
            #5

            Oh, come on! I think you need a hug ;P Happy to help you out. :)

            1 Reply Last reply
            0
            • L Lost User

              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:

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • L Lost User

                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:

                K Offline
                K Offline
                King Julien
                wrote on last edited by
                #7

                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.....

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups