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

Author Topic: batch file for clearing a folder in c drive  (Read 4143 times)

0 Members and 1 Guest are viewing this topic.

yuva_17raj

    Topic Starter


    Starter

    batch file for clearing a folder in c drive
    « on: May 24, 2008, 12:33:47 AM »
    hi i am using tomcat to run my application so that more than one client access my application and when the client logged in to my application each time 4 log files created in the following folder C:\Program Files\Apache Software Foundation\Tomcat 5.5\logs so that my application runs very slow and here i need to clear the particular folder or move the files from the folder to D:/templogs so that i need a batch program to do the specified process kindly reply me with the solution
    regards
    yuvaraj

    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: batch file for clearing a folder in c drive
    « Reply #1 on: May 24, 2008, 12:56:48 AM »
    Have a look at the Move command

    It would be something like this:

    move "C:\Program Files\Apache Software Foundation\Tomcat 5.5\logs\file.log" "D:\Templogs\file.log"

    yuva_17raj

      Topic Starter


      Starter

      Re: batch file for clearing a folder in c drive
      « Reply #2 on: May 24, 2008, 01:30:47 AM »
      yes i got it
      thanks and regards
      yuvaraj

      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: batch file for clearing a folder in c drive
      « Reply #3 on: May 24, 2008, 01:33:08 AM »
       ;)

      yuva_17raj

        Topic Starter


        Starter

        Re: batch file for clearing a folder in c drive
        « Reply #4 on: May 26, 2008, 01:20:04 AM »
        hi as i have specified that my application is running under Tomcat as a server in online so here i should not stop the tomcat to move the file but my process has to continue i have used the simple code as follows

        move /y "C:\Program Files\Apache Software Foundation\Tomcat 5.5\logs\*.*" "D:\test" so here i have the problem that my tomcat will always running but i should move the files without stopping the tomcat how to achive this using batch programs
        regards
        yuvaraj

        Carbon Dudeoxide

        • Global Moderator

        • Mastermind
        • Thanked: 169
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Experience: Guru
        • OS: Mac OS
        Re: batch file for clearing a folder in c drive
        « Reply #5 on: May 26, 2008, 03:02:53 AM »
        So if I understand this correctly, you want to back up the logs in D:\test but you can't move them because the program is in use.

        Try the copy command:

        Code: [Select]
        copy "C:\Program Files\Apache Software Foundation\Tomcat 5.5\logs\*.*" "D:\test"