One-line batch script to delete empty directories - The Old New Thing - Site Home - MSDN Blogs
WORKING: for /f "usebackq delims=" %d in ('dir /ad/b/s d:\') do rd "%d"

forfiles /p d:\ /m * /d -1 /s /c "cmd /c del /q @path"
d 
7 weeks ago
How do i create a directory in powershell
WORKING:
forfiles /p d:\ /s /c "cmd /c del /q @path"
d 
7 weeks ago
Create Batch file to delete files and subfolders, but not root folder
forfiles /p d:\ /m * /s /d -1 /c "cmd /c del @path\@file"

rem forfiles /p d:\ /m * /s /d -1 /c "cmd /c del @path\@file"

forfiles /p "C:\test-folder" /s /d -1 /C "cmd /c del /q @path"
d 
7 weeks ago
Dir - list files and folders | Windows CMD | SS64.com
' Usage: cscript deloldfiles.vbs c:\dba\log 3
' : It deletes files older than 3 days
Set objArgs = WScript.Arguments
FolderName =objArgs(0)
Days=objArgs(1)

set fso = createobject("scripting.filesystemobject")
set folders = fso.getfolder(FolderName)
datetoday = now()
newdate = dateadd("d", Days*-1, datetoday)
recurse folders

sub recurse( byref folders)
set subfolders = folders.subfolders
set files = folders.files
for each file in files
if file.datelastmodified < newdate then
wscript.echo "Deleting " & folders.path & "\" & file.name & " last modified: " & file.datelastmodified
on error resume next
file.delete
end if

next

for each folder in subfolders
recurse folder
next

set subfolders = nothing
set files = nothing

end sub
d 
7 weeks ago
« earlier      
accesschecker accessibility activedirectory bibliography box changemanagement concur d ebsco enrollmentchecker ezproxy filezilla footprints ftp git grants grouppolicy guestaccounts horse howto identityfinder ironport it-list itim itproblemreport iug languagebar lcc ldap listserv networkregistration ninite oclc ohiolink ohionet oitphonelist ouhistory outage overseaschineseconfederation ovgtsl p2 patrondata pcounter peoplesoft pharos pinboard pivot poynters printing productservicesweb quarantine sccm servicedeskinfo sierra sophos ssh sslvpn staffphonelist style sysvol voicemail voinovich wcilcos webjetadmin webphonemanager webservicesblog wifi zclib

Copy this bookmark:



description:


tags: