Announcement

Collapse
No announcement yet.

DOS help Needed!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DOS help Needed!!!

    I'm trying to make a batch file for an OS2 system (yea I know) that will backup some data files. I have it all done, but the last thing I need it to do is rename the dir that the files where copied into using a name typed in by the user.
    I.E. ren c:\back (user input).
    With all the programming knowledge that is on this forum I'm hoping someone can help!


    Looked for sometime on the web with no luck. Thanks for your help Al.

    Thanks in advance!!!!
    Oboy
    Time to make the wafers!
    Oboy Inside!

    intel P4 2.26 @ 2.957Ghz

    "Life isn't like a box of chocolates...it's more like a jar of
    jalapenos. What you do today, might burn your ass tomorrow."

  • #2
    you should be able to use the 'ren' command in a batch file... I have done it on many occasion...
    The Welsh support two teams when it comes to rugby. Wales of course, and anyone else playing England

    Comment


    • #3
      You can't rename a directory.
      What you can do is:
      create a backup dir and put everything into it.
      Create a new dir according to user input and move all the files into that directory.
      Delete backup dir.
      "For every action, there is an equal and opposite criticism."

      Comment


      • #4
        Like Anan said you can't rename a directory in pure DOS.

        But you can use the "move" command IIRC (it's been a long time), much easier than Anan's solution.

        E.g. "move c:\oldirname c:\newdirname"
        Last edited by KeiFront; 24 December 2003, 03:41.
        Main: Dual Xeon LV2.4Ghz@3.1Ghz | 3X21" | NVidia 6800 | 2Gb DDR | SCSI
        Second: Dual PIII 1GHz | 21" Monitor | G200MMS + Quadro 2 Pro | 512MB ECC SDRAM | SCSI
        Third: Apple G4 450Mhz | 21" Monitor | Radeon 8500 | 1,5Gb SDRAM | SCSI

        Comment


        • #5
          use xcopy to copy the directory to the target, then delete the original directory if the move command cannot be found/used.
          80% of people think I should be in a Mental Institute

          Comment

          Working...
          X