cleanup.cmd

10:37 PM

' ===================================================================================================
'
'          Name: cleanup.cmd
'   Description: Batch script that will take a given directory path and delete all sub directories
'                and the existing directory of all files then create a new README.TXT file
'    Written By: Aslam latheef
'          Date: 5/11/2011
'
'  Script Usage: cscript //nologo createCustomer.vbs
'   Result Code: N/A
'       Example: D:\Windows\Scripts\cleanup.cmd
'
'
'  *** Notes ***
'
1) This will forcefully delete all content in the designated directory so be CAREFUL
2) For more information or help, please email corp-tech@opsource.net
'
' ===================================================================================================
 
@echo off
 
SET REPLTEMP=E:\Temp
SET READMEFILE=E:\Temp\README.TXT
 
: Force deletion of all files in the directory specified for the variable %REPLTEMP%
for /f "tokens=*" %%a in ('dir %REPLTEMP% /a:d /b') do rd "%REPLTEMP%\%%a" /s /q
del "%REPLTEMP%\*.*" /q /f
 
: Create README.TXT file for directory usage
echo *** PLEASE READ - Directory Usage Guidelines *** > %READMEFILE%
echo. >> %READMEFILE%
echo This folder is used as temp storage between all data centers.  All directory contents are >> %READMEFILE%
echo deleted every Monday at 3 AM PT/6 AM ET.  There are NO EXCEPTIONS to this policy.  Likewise, >> %READMEFILE%
echo this directory is considered "temporary" so do not use this as a common push point for data >> %READMEFILE%
echo your customer needs to constantly replicate. Separate processes should be setup for a more >> %READMEFILE%
echo permanent file transfer needs. >> %READMEFILE%
echo. >> %READMEFILE%
echo Thank you.  >> %READMEFILE%
 
EXIT

You Might Also Like

0 comments

Contact Form

Name

Email *

Message *

Translate

Wikipedia

Search results