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 
september 2014
How do i create a directory in powershell
WORKING:
forfiles /p d:\ /s /c "cmd /c del /q @path"
d 
september 2014
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 
september 2014
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 
september 2014
« earlier      
accesschecker accessibility activedirectory bibliography box catmail changemanagement comdoc concur d ebsco enrollmentchecker ezproxy filezilla flexplace footprints ftp git grants grouppolicy guestaccounts horse howto identityfinder ironport it-list itim itproblemreport iug lamp languagebar lcc ldap listserv networkregistration ninite oclc ohiolink ohionet oit oitphonelist ouhistory outage overseaschineseconfederation ovgtsl p2 patrondata pcounter peoplesoft pharos pinboard pivot poynters printing productservicesweb quarantine recordsretention sccm servicecatalog servicedeskinfo sierra sophos ssh sslvpn staffphonelist style sysvol voicemail voinovich wcilcos webjetadmin webphonemanager webservicesblog wifi zclib

Copy this bookmark:



description:


tags: