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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Copying current program to a location..... help please!

Copying current program to a location..... help please!

Scheduled Pinned Locked Moved C#
csharphelpquestion
5 Posts 3 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 have written a simple console program which will accept username and display it. Now I want that along with this simple function, the program also copies itself to a particular location, say C:/Program Files. Such that the user need not copy and paste it to the above location systematically. Is the code something like this: this.copy("C:/Program Files"); But this doesn't seem to work and I get errors. Whats the correct code for this then? Remember that I want the entire program to copy itself (replicate) to that location. Your help will truly be admired, Rajdeep.NET

    1 M 2 Replies Last reply
    0
    • L Lost User

      Hi guys, I have written a simple console program which will accept username and display it. Now I want that along with this simple function, the program also copies itself to a particular location, say C:/Program Files. Such that the user need not copy and paste it to the above location systematically. Is the code something like this: this.copy("C:/Program Files"); But this doesn't seem to work and I get errors. Whats the correct code for this then? Remember that I want the entire program to copy itself (replicate) to that location. Your help will truly be admired, Rajdeep.NET

      1 Offline
      1 Offline
      12Code
      wrote on last edited by
      #2

      Use setup to redirect your files to c:\Program Files.

      ;)*12Code

      L 1 Reply Last reply
      0
      • 1 12Code

        Use setup to redirect your files to c:\Program Files.

        ;)*12Code

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

        Will I have to create Setup for a small console application like this? Sorry, its my fault. Its a console program. Tell me how would I programetically do the stuff?

        1 1 Reply Last reply
        0
        • L Lost User

          Will I have to create Setup for a small console application like this? Sorry, its my fault. Its a console program. Tell me how would I programetically do the stuff?

          1 Offline
          1 Offline
          12Code
          wrote on last edited by
          #4

          Please use setup. This is what the setup for. Setup is easy to create in VS, why not use it? Program can't relocate itself to other location.

          ;)*12Code

          1 Reply Last reply
          0
          • L Lost User

            Hi guys, I have written a simple console program which will accept username and display it. Now I want that along with this simple function, the program also copies itself to a particular location, say C:/Program Files. Such that the user need not copy and paste it to the above location systematically. Is the code something like this: this.copy("C:/Program Files"); But this doesn't seem to work and I get errors. Whats the correct code for this then? Remember that I want the entire program to copy itself (replicate) to that location. Your help will truly be admired, Rajdeep.NET

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

            Rajdeep.NET wrote:

            this.copy("C:/Program Files"); But this doesn't seem to work and I get errors

            :laugh: I do enjoy a good laugh in the mornings :laugh: You cant just write code like that and expect it to work. others i would frequently use...

            this.FinishTheRestForMe();

            And you certainly cannot move/copy an program that is running. As has been suggested you will want to use a setup for your requirements, even if its just a little console application.

            Life goes very fast. Tomorrow, today is already yesterday.

            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