Organize a few more command tool scripts that are used on everyday windows.
Delete all files in directory and directory
@echo on
CD/D E:\test
FOR/R%%s in (., *) do rd/q/s%%s\ new Folder
Exit
REM Deletes all the specified folders under a directory
Second, automatic compression after deletion
@echo off
xcopy d:\inetpub\4fweb\* D:\Inetpub\taosf.bak\/s
CD \
cd c:\program Files
CD winrar
Rar.exe a-ag-r-m5-df D:\DB_back\hjl_taosf.rar D:\Inetpub\taosf.bak\
Pause
Three, automatic mapping of shared disk
@echo off
net use y: \\192.168.22.80\ Information Department [email protected]/user:it/persistent:yes
rem [email protected] is the password, user:it login is it persistent automatic?
Iv. Restarting IIS
@echo off
net stop Iisadmin/yes
net start IISAdmin
net start w3svc
del/f/s/q%systemdrive%\*.tmp
del/f/s/q%SYSTEMDRIVE%\*._MP
del/f/s/q%systemdrive%\*.gid
del/f/s/q%systemdrive%\*.chk
del/f/s/q%systemdrive%\*.old
del/f/s/q%systemdrive%\recycled\*.*
del/f/s/q%windir%\*.bak
del/f/s/q%windir%\prefetch\*.*
del/f/q%userprofile%\cookies\*.*
del/f/q%userprofile%\recent\*.*
del/f/s/q "%userprofile%\local settings\temporary Internet files\*.*"
del/f/s/q "%USERPROFILE%\Local settings\temp\*.*"
del/f/s/q "%userprofile%\recent\*.*"
Exit
V. Delete files prior to the specified day
@echo off
:: Requires support from the Forfiles command win2003/vista/win7 system
REM Specifies the storage path of the file to be deleted
Set Srcdir=f:\record
REM Specified days
Set daysago=90
REM forfiles/p%srcdir%/s/m */d-%daysago%/C "cmd/c del/f/q/a @path"
forfiles/p%srcdir%/s/m */d-%daysago%/C "cmd/c del/f/q/a @path"
For files/p%srcdir%/m/d-%daysago%/C "If @ISDIR ==true rd/s/q @PATH"
Pause
Windows Utility Scripts