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. The Lounge
  3. dos command needed

dos command needed

Scheduled Pinned Locked Moved The Lounge
question
5 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

    I am making a batch file and l need to clear the contents of a file that always gets written with some data and the project does not compile. I need a way to clear the file or delete the file and recreate the file empty any ideas ? Thanks in Advance

    S M J 3 Replies Last reply
    0
    • L Lost User

      I am making a batch file and l need to clear the contents of a file that always gets written with some data and the project does not compile. I need a way to clear the file or delete the file and recreate the file empty any ideas ? Thanks in Advance

      S Offline
      S Offline
      Steve Mayfield
      wrote on last edited by
      #2

      manually create an empty file (only need to do it once) and then copy it to the file you want to clear out within the batch file (or you can do it within a makefile) Steve

      1 Reply Last reply
      0
      • L Lost User

        I am making a batch file and l need to clear the contents of a file that always gets written with some data and the project does not compile. I need a way to clear the file or delete the file and recreate the file empty any ideas ? Thanks in Advance

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        echo. > filename.ext That will actually write \r\n to the file, instead of making it 0 bytes. If you must have it be 0 bytes, you could grab a port of the Unix command "touch".

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

        1 Reply Last reply
        0
        • L Lost User

          I am making a batch file and l need to clear the contents of a file that always gets written with some data and the project does not compile. I need a way to clear the file or delete the file and recreate the file empty any ideas ? Thanks in Advance

          J Offline
          J Offline
          Jerome Parrot
          wrote on last edited by
          #4

          copy nul emptyFile

          L 1 Reply Last reply
          0
          • J Jerome Parrot

            copy nul emptyFile

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

            cool thanks guys !!!

            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