Loading ...
Sorry, an error occurred while loading the content.
 

deleting tmp files from all users

Expand Messages
  • Aristos Vasiliou
    I am currently using the following batch file to do a cleanup attrib -h -s C: RECYCLER attrib -h -s D: RECYCLER RD /s /q C: RECYCLER RD /s /q D: RECYCLER DEL
    Message 1 of 12 , May 26, 2010
      I am currently using the following batch file to do a cleanup



      attrib -h -s C:\RECYCLER
      attrib -h -s D:\RECYCLER
      RD /s /q C:\RECYCLER
      RD /s /q D:\RECYCLER
      DEL /Q /S /F "%TMP%\*.*"
      DEL /Q /S /F "%WINDIR%\*.log"
      DEL /Q /S /F "%WINDIR%\*.tmp"
      DEL /Q /S /F "%WINDIR%\Temp\*.*"
      DEL /Q /S /F "%USERPROFILE%\Recent\*.*"
      DEL /Q /S /F "%USERPROFILE%\Cookies\*.*"
      DEL /Q /S /F "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"



      The last three lines clean up tmp files from the current user profile. Is there a way that this batch file can enter all the user�s profiles under C:\Documents and Settings and delete the tmp files in those also?



      Also, does anyone know any other paths I can add in the batch file for cleaning not needed files?



      Thanks.


      [Non-text portions of this message have been removed]
    • foxidrive@lavabit.com
      On Thu, 27 May 2010 05:53:15 +0000, Aristos Vasiliou ... You will have permission issues if you try to prune files from another users profile. I think you can
      Message 2 of 12 , May 27, 2010
        On Thu, 27 May 2010 05:53:15 +0000, Aristos Vasiliou
        <aristos@...> wrote:

        >I am currently using the following batch file to do a cleanup
        >
        >
        >
        >attrib -h -s C:\RECYCLER
        >attrib -h -s D:\RECYCLER
        >RD /s /q C:\RECYCLER
        >RD /s /q D:\RECYCLER
        >DEL /Q /S /F "%TMP%\*.*"
        >DEL /Q /S /F "%WINDIR%\*.log"
        >DEL /Q /S /F "%WINDIR%\*.tmp"
        >DEL /Q /S /F "%WINDIR%\Temp\*.*"
        >DEL /Q /S /F "%USERPROFILE%\Recent\*.*"
        >DEL /Q /S /F "%USERPROFILE%\Cookies\*.*"
        >DEL /Q /S /F "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
        >
        >
        >
        >The last three lines clean up tmp files from the current user profile. Is there a way that this batch file can enter all the user’s profiles under C:\Documents and Settings and delete the tmp files in those also?
        >
        >
        >
        >Also, does anyone know any other paths I can add in the batch file for cleaning not needed files?

        You will have permission issues if you try to prune files from another
        users profile.

        I think you can add %ALLUSERSPROFILE% though (XP at least) and %temp%
      • Aristos Vasiliou
        I will be running the batch file as an administrator, so I wont be having permissions problems. The %ALLUSERSPROFILE% is a single folder named All Users under
        Message 3 of 12 , May 27, 2010
          I will be running the batch file as an administrator, so I wont be having permissions problems. The %ALLUSERSPROFILE% is a single folder named All Users under C:\Documents and Settings though. It's not like goihg through all the folders under C:\Documents and Settings

          Thanks
          ________________________________
          From: batchworld@yahoogroups.com [batchworld@yahoogroups.com] on behalf of foxidrive@... [foxidrive@...]
          Sent: Thursday, May 27, 2010 11:53 AM
          To: batchworld@yahoogroups.com
          Subject: Re: [BATCH WORLD] deleting tmp files from all users



          On Thu, 27 May 2010 05:53:15 +0000, Aristos Vasiliou
          <aristos@...<mailto:aristos%40aristos.net>> wrote:

          >I am currently using the following batch file to do a cleanup
          >
          >
          >
          >attrib -h -s C:\RECYCLER
          >attrib -h -s D:\RECYCLER
          >RD /s /q C:\RECYCLER
          >RD /s /q D:\RECYCLER
          >DEL /Q /S /F "%TMP%\*.*"
          >DEL /Q /S /F "%WINDIR%\*.log"
          >DEL /Q /S /F "%WINDIR%\*.tmp"
          >DEL /Q /S /F "%WINDIR%\Temp\*.*"
          >DEL /Q /S /F "%USERPROFILE%\Recent\*.*"
          >DEL /Q /S /F "%USERPROFILE%\Cookies\*.*"
          >DEL /Q /S /F "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
          >
          >
          >
          >The last three lines clean up tmp files from the current user profile. Is there a way that this batch file can enter all the user�s profiles under C:\Documents and Settings and delete the tmp files in those also?
          >
          >
          >
          >Also, does anyone know any other paths I can add in the batch file for cleaning not needed files?

          You will have permission issues if you try to prune files from another
          users profile.

          I think you can add %ALLUSERSPROFILE% though (XP at least) and %temp%





          [Non-text portions of this message have been removed]
        • foxidrive@lavabit.com
          On Thu, 27 May 2010 09:03:39 +0000, Aristos Vasiliou ... I can t test this as I only have one account but won t you have to take ownership of the files before
          Message 4 of 12 , May 27, 2010
            On Thu, 27 May 2010 09:03:39 +0000, Aristos Vasiliou
            <aristos@...> wrote:

            >I will be running the batch file as an administrator, so I wont be having permissions problems.

            I can't test this as I only have one account but won't you have to take
            ownership of the files before you can delete them?

            >The %ALLUSERSPROFILE% is a single folder named All Users under C:\Documents and Settings though.

            One folder? I have a tree of all kinds of stuff there.
          • Aristos Vasiliou
            Yes, running %allusersprofile% will get you in C: Documents and Settings All Users which contains other folders and files. But what I need to do, is get in
            Message 5 of 12 , May 27, 2010
              Yes, running "%allusersprofile%" will get you in "C:\Documents and Settings\All Users" which contains other folders and files. But what I need to do, is get in all the folders under "C:\Documents and Settings\" (which contains every user profile created on the system) and delete unnecessary files.

              I have 120 folders under "C:\Documents and Settings\", one folder for each user profile. Each one has it's own temporary internet files, cookies, and recent, which I need to clean.

              ________________________________
              From: batchworld@yahoogroups.com [batchworld@yahoogroups.com] on behalf of foxidrive@... [foxidrive@...]
              Sent: Thursday, May 27, 2010 2:11 PM
              To: batchworld@yahoogroups.com
              Subject: Re: [BATCH WORLD] deleting tmp files from all users



              On Thu, 27 May 2010 09:03:39 +0000, Aristos Vasiliou
              <aristos@...<mailto:aristos%40aristos.net>> wrote:

              >I will be running the batch file as an administrator, so I wont be having permissions problems.

              I can't test this as I only have one account but won't you have to take
              ownership of the files before you can delete them?

              >The %ALLUSERSPROFILE% is a single folder named All Users under C:\Documents and Settings though.

              One folder? I have a tree of all kinds of stuff there.





              [Non-text portions of this message have been removed]
            • foxidrive@lavabit.com
              On Thu, 27 May 2010 11:59:41 +0000, Aristos Vasiliou ... @echo off pushd C: Documents and Settings for /f %%a in ( dir /b /ad ) do ( echo del %%a Local
              Message 6 of 12 , May 27, 2010
                On Thu, 27 May 2010 11:59:41 +0000, Aristos Vasiliou
                <aristos@...> wrote:

                >Yes, running "%allusersprofile%" will get you in "C:\Documents and Settings\All Users" which contains other folders and files. But what I need to do, is get in all the folders under "C:\Documents and Settings\" (which contains every user profile created on the system) and delete unnecessary files.
                >
                >I have 120 folders under "C:\Documents and Settings\", one folder for each user profile. Each one has it's own temporary internet files, cookies, and recent, which I need to clean.


                @echo off
                pushd "C:\Documents and Settings"
                for /f %%a in ('dir /b /ad') do (
                echo del "%%a\Local Settings\Temporary Internet Files" here
                )
                popd
                pause
              • foxidrive@lavabit.com
                ... A correction to cater for spaces etc in long filenames. @echo off pushd C: Documents and Settings for /f delims= %%a in ( dir /b /ad ) do ( echo del
                Message 7 of 12 , May 27, 2010
                  On Thu, 27 May 2010 22:11:46 +1000, foxidrive@... wrote:

                  >On Thu, 27 May 2010 11:59:41 +0000, Aristos Vasiliou
                  ><aristos@...> wrote:
                  >
                  >>Yes, running "%allusersprofile%" will get you in "C:\Documents and Settings\All Users" which contains other folders and files. But what I need to do, is get in all the folders under "C:\Documents and Settings\" (which contains every user profile created on the system) and delete unnecessary files.
                  >>
                  >>I have 120 folders under "C:\Documents and Settings\", one folder for each user profile. Each one has it's own temporary internet files, cookies, and recent, which I need to clean.
                  >

                  A correction to cater for spaces etc in long filenames.

                  @echo off
                  pushd "C:\Documents and Settings"
                  for /f "delims=" %%a in ('dir /b /ad') do (
                  echo del "%%a\Local Settings\Temporary Internet Files" here
                  )
                  popd
                  pause
                • Aristos Vasiliou
                  It seems to be going in the folder, but it s not deleting anything http://img709.imageshack.us/img709/7434/cleanupe.jpg This is the path I used @echo off pushd
                  Message 8 of 12 , May 27, 2010
                    It seems to be going in the folder, but it's not deleting anything

                    http://img709.imageshack.us/img709/7434/cleanupe.jpg

                    This is the path I used

                    @echo off
                    pushd "C:\Documents and Settings"
                    for /f %%a in ('dir /b /ad') do (echo del "%%a\Local Settings\Temporary Internet Files\Content.IE5")
                    popd
                    pause


                    ________________________________
                    From: batchworld@yahoogroups.com [batchworld@yahoogroups.com] on behalf of foxidrive@... [foxidrive@...]
                    Sent: Thursday, May 27, 2010 3:11 PM
                    To: batchworld@yahoogroups.com
                    Subject: Re: [BATCH WORLD] deleting tmp files from all users



                    On Thu, 27 May 2010 11:59:41 +0000, Aristos Vasiliou
                    <aristos@...<mailto:aristos%40aristos.net>> wrote:

                    >Yes, running "%allusersprofile%" will get you in "C:\Documents and Settings\All Users" which contains other folders and files. But what I need to do, is get in all the folders under "C:\Documents and Settings\" (which contains every user profile created on the system) and delete unnecessary files.
                    >
                    >I have 120 folders under "C:\Documents and Settings\", one folder for each user profile. Each one has it's own temporary internet files, cookies, and recent, which I need to clean.

                    @echo off
                    pushd "C:\Documents and Settings"
                    for /f %%a in ('dir /b /ad') do (
                    echo del "%%a\Local Settings\Temporary Internet Files" here
                    )
                    popd
                    pause





                    [Non-text portions of this message have been removed]
                  • foxidrive@lavabit.com
                    On Thu, 27 May 2010 12:30:37 +0000, Aristos Vasiliou ... Note the change I posted that includes the delims= You will have to change the ECHO command to a DEL
                    Message 9 of 12 , May 27, 2010
                      On Thu, 27 May 2010 12:30:37 +0000, Aristos Vasiliou
                      <aristos@...> wrote:

                      >It seems to be going in the folder, but it's not deleting anything
                      >
                      >http://img709.imageshack.us/img709/7434/cleanupe.jpg
                      >
                      >This is the path I used
                      >
                      >@echo off
                      >pushd "C:\Documents and Settings"
                      >for /f %%a in ('dir /b /ad') do (echo del "%%a\Local Settings\Temporary Internet Files\Content.IE5")
                      >popd
                      >pause

                      Note the change I posted that includes the "delims="

                      You will have to change the ECHO command to a DEL command.
                    • Aristos Vasiliou
                      This batch file is extremely useful. It just cleaned up 35GB of useless files on one of my terminal servers. Thank you very much @echo off attrib -h -s
                      Message 10 of 12 , May 27, 2010
                        This batch file is extremely useful. It just cleaned up 35GB of useless files on one of my terminal servers.

                        Thank you very much

                        @echo off
                        attrib -h -s C:\RECYCLER
                        attrib -h -s D:\RECYCLER
                        RD /s /q C:\RECYCLER
                        RD /s /q D:\RECYCLER
                        DEL /Q /S /F "%TMP%\*.*"
                        DEL /Q /S /F "%WINDIR%\*.log"
                        DEL /Q /S /F "%WINDIR%\*.tmp"
                        DEL /Q /S /F "%WINDIR%\Temp\*.*"
                        pushd "C:\Documents and Settings"
                        for /f "delims=" %%a in ('dir /b /ad') do (DEL /Q /F /S "%%a\Recent\*.*")
                        for /f "delims=" %%a in ('dir /b /ad') do (DEL /Q /F /S "%%a\Cookies\*.*")
                        for /f "delims=" %%a in ('dir /b /ad') do (DEL /Q /F /S "%%a\Local Settings\Temp\*.*")
                        for /f "delims=" %%a in ('dir /b /ad') do (DEL /Q /F /S "%%a\Local Settings\Temporary Internet Files\*.*")
                        popd

                        ________________________________
                        From: Aristos Vasiliou
                        Sent: Thursday, May 27, 2010 4:57 PM
                        To: batchworld@yahoogroups.com
                        Subject: RE: [BATCH WORLD] deleting tmp files from all users

                        ________________________________
                        From: batchworld@yahoogroups.com [batchworld@yahoogroups.com] on behalf of foxidrive@... [foxidrive@...]
                        Sent: Thursday, May 27, 2010 3:54 PM
                        To: batchworld@yahoogroups.com
                        Subject: Re: [BATCH WORLD] deleting tmp files from all users



                        On Thu, 27 May 2010 12:30:37 +0000, Aristos Vasiliou
                        <aristos@...<mailto:aristos%40aristos.net>> wrote:

                        >It seems to be going in the folder, but it's not deleting anything
                        >
                        >http://img709.imageshack.us/img709/7434/cleanupe.jpg
                        >
                        >This is the path I used
                        >
                        >@echo off
                        >pushd "C:\Documents and Settings"
                        >for /f %%a in ('dir /b /ad') do (echo del "%%a\Local Settings\Temporary Internet Files\Content.IE5")
                        >popd
                        >pause

                        Note the change I posted that includes the "delims="

                        You will have to change the ECHO command to a DEL command.





                        [Non-text portions of this message have been removed]
                      • foxidrive@lavabit.com
                        On Thu, 27 May 2010 14:10:05 +0000, Aristos Vasiliou wrote: You can do this in one loop, but your method is functional. pushd
                        Message 11 of 12 , May 27, 2010
                          On Thu, 27 May 2010 14:10:05 +0000, Aristos Vasiliou
                          <aristos@...> wrote:

                          You can do this in one loop, but your method is functional.


                          pushd "C:\Documents and Settings"
                          for /f "delims=" %%a in ('dir /b /ad') do (
                          DEL /Q /F /S "%%a\Recent\*.*"
                          DEL /Q /F /S "%%a\Cookies\*.*"
                          DEL /Q /F /S "%%a\Local Settings\Temp\*.*"
                          DEL /Q /F /S "%%a\Local Settings\Temporary Internet Files\*.*"
                          )
                          popd


                          The only other thing I'd mention is that the script is written for your
                          situation and for anyone reading this at a later date, it will need to
                          be modified for other versions of Windows, as well as a case where the
                          Windows drive is not c:
                        • Theodorik OBroin
                          Hi Aristos, Yup - I have a batch file for deleting temp directories for all users in documents and settings. I ll post it here next week when I get back to
                          Message 12 of 12 , May 28, 2010
                            Hi Aristos,

                            Yup - I have a batch file for deleting temp directories for all users in
                            documents and settings.
                            I'll post it here next week when I get back to work - it works very well.

                            Theo


                            On 27 May 2010 06:53, Aristos Vasiliou <aristos@...> wrote:

                            > I am currently using the following batch file to do a cleanup
                            >
                            >
                            >
                            > attrib -h -s C:\RECYCLER
                            > attrib -h -s D:\RECYCLER
                            > RD /s /q C:\RECYCLER
                            > RD /s /q D:\RECYCLER
                            > DEL /Q /S /F "%TMP%\*.*"
                            > DEL /Q /S /F "%WINDIR%\*.log"
                            > DEL /Q /S /F "%WINDIR%\*.tmp"
                            > DEL /Q /S /F "%WINDIR%\Temp\*.*"
                            > DEL /Q /S /F "%USERPROFILE%\Recent\*.*"
                            > DEL /Q /S /F "%USERPROFILE%\Cookies\*.*"
                            > DEL /Q /S /F "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
                            >
                            >
                            >
                            > The last three lines clean up tmp files from the current user profile. Is
                            > there a way that this batch file can enter all the user�s profiles under
                            > C:\Documents and Settings and delete the tmp files in those also?
                            >
                            >
                            >
                            > Also, does anyone know any other paths I can add in the batch file for
                            > cleaning not needed files?
                            >
                            >
                            >
                            > Thanks.
                            >
                            >
                            > [Non-text portions of this message have been removed]
                            >
                            >
                            >
                            > ------------------------------------
                            >
                            > To Post a message, send it to: batchworld@...
                            >
                            > To Unsubscribe, send a blank message to:
                            > batchworld-unsubscribe@...! Groups Links
                            >
                            >
                            >
                            >


                            --

                            There are only 10 types of people in the world.
                            Those who understand binary,
                            and those who don't.


                            [Non-text portions of this message have been removed]
                          Your message has been successfully submitted and would be delivered to recipients shortly.