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 / C++ / MFC
  4. CopyFile help!

CopyFile help!

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 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.
  • R Offline
    R Offline
    Ryan McDermott
    wrote on last edited by
    #1

    I need source code for a program that copies itself into a certain directory with a certain name like "C:\Program Files\something.exe" -Ryan M.

    R T 2 Replies Last reply
    0
    • R Ryan McDermott

      I need source code for a program that copies itself into a certain directory with a certain name like "C:\Program Files\something.exe" -Ryan M.

      R Offline
      R Offline
      Rafael Fernandez Lopez
      wrote on last edited by
      #2

      I'm not sure if an app that is running can be copied itself or even can be copied by other process...


      Written by: Rafael Fernández López.

      Visit: http://www.maestroprogramador.com

      D 1 Reply Last reply
      0
      • R Rafael Fernandez Lopez

        I'm not sure if an app that is running can be copied itself or even can be copied by other process...


        Written by: Rafael Fernández López.

        Visit: http://www.maestroprogramador.com

        D Offline
        D Offline
        Diddy
        wrote on last edited by
        #3

        It can - like this: TCHAR szFileName[MAX_PATH]; ::GetModuleFileName(szFileName, MAX_PATH]; LPCTSTR pszDest = _T("C:\\Program Files\\SomeApp.exe"); ::CopyFile(szModuleFileName, pszDest);

        1 Reply Last reply
        0
        • R Ryan McDermott

          I need source code for a program that copies itself into a certain directory with a certain name like "C:\Program Files\something.exe" -Ryan M.

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          look for [ShFileOperation] api!

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta

          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