Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: RD batch file  (Read 5411 times)

0 Members and 1 Guest are viewing this topic.

zavin

    Topic Starter


    Newbie

    RD batch file
    « on: March 27, 2009, 03:29:27 PM »
     I am using the following line in a batch file, but it always ask if its  a file or a directory. How do I get around this? I need it to run unattended nightly.

    RMDIR /S /Q "J:\backup"

    Computer Hope Admin

    • Administrator


    • Prodigy

      Thanked: 248
      • Yes
      • Yes
      • Yes
      • Computer Hope
    • Certifications: List
    • Computer: Specs
    • Experience: Guru
    • OS: Windows 10
    Re: RD batch file
    « Reply #1 on: March 27, 2009, 03:39:17 PM »
    That command should would fine with no errors, tested in Vista and XP with no issues. What may be happening is that there is a file and directory with the same name and maybe that's confusing it. Maybe try adding a backslash to the end, e.g.

    rmdir /s /q j:\backup\
    Everybody is a genius. But, if you judge a fish by its ability to climb a tree, it will spend its whole life believing that it is stupid.
    -Albert Einstein

    zavin

      Topic Starter


      Newbie

      Re: RD batch file
      « Reply #2 on: March 27, 2009, 03:49:04 PM »
       That did it. Thanks for the help.

      Computer Hope Admin

      • Administrator


      • Prodigy

        Thanked: 248
        • Yes
        • Yes
        • Yes
        • Computer Hope
      • Certifications: List
      • Computer: Specs
      • Experience: Guru
      • OS: Windows 10
      Re: RD batch file
      « Reply #3 on: March 27, 2009, 03:50:15 PM »
      Glad to hear and you're welcome. :)
      Everybody is a genius. But, if you judge a fish by its ability to climb a tree, it will spend its whole life believing that it is stupid.
      -Albert Einstein