MSFN Forum: Script to delete folders - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Script to delete folders by mask Rate Topic: -----

#1 User is offline   lsrkin 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 28-February 08

Posted 30 May 2008 - 09:36 PM

cd %ALLUSERSPROFILE%
cd..
for /D /R %%i in (7z*.tmp) do rmdir /S /Q %%i


here's my batch file for deleting all temp directories in "Documents and Settings" folder and all subfolders

The thing is that the line
for /D /R %%i in (7z*.tmp) do rmdir /S /Q %%i


doesn't execute from "C:\Documents and Settings" folder

It executes from whete my batch file is!!!
So the whole script is useless.

Any suggestions??


UPD.:
Found a solution

cd /d %ALLUSERSPROFILE%
cd /d ..
for /D /R %%i in (7z*.tmp) do rmdir /S /Q %%~fsi

This post has been edited by lsrkin: 30 May 2008 - 10:25 PM



Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy