1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
| '--------------------------------------------------------------------------
' This script deletes the file to free up on disks
'
' Commands are in files : CmdLine.bat
'--------------------------------------------------------------------------
'
' VARIABLES
'
'--------------------------------------------------------------------------
dim CmdLine, folder
dim WINDIR
Set WshShell = WScript.CreateObject("WScript.Shell" )
WINDIR = WshShell.ExpandEnvironmentStrings("%WinDir%" )
Set fso = CreateObject("Scripting.FileSystemObject" )
Set MyFile = fso.CreateTextFile("c:\AdminServeurs\CmdLine.bat" ,True)
'--------------------------------------------------------------------------
'
' Delete of tempory file
'
'--------------------------------------------------------------------------
folder = WINDIR & "\temp"
if fso.FolderExists(folder) then
CmdLine = "del " & folder & "\*.* /Q /F "
MyFile.WriteLine(CmdLine)
end If
'--------------------------------------------------------------------------
folder = WINDIR & "\system32\config\%USER%\local settings\temp"
if fso.FolderExists(folder) then
CmdLine = "del " & folder & "\*.* /Q /F /S"
MyFile.WriteLine(CmdLine)
end If
'--------------------------------------------------------------------------
folder = "c:\Temp"
if fso.FolderExists(folder) then
CmdLine = "del " & folder & "\*.* /Q /F /S"
MyFile.WriteLine(CmdLine)
end If
'--------------------------------------------------------------------------
'
' Empty the directory RECYCLER
'
'--------------------------------------------------------------------------
folder = "c:\RECYCLER"
if fso.FolderExists(folder) then
CmdLine = "del " & folder & "\*.* /Q /F /S /A"
MyFile.WriteLine(CmdLine)
end If
'--------------------------------------------------------------------------
'
' Delete the directory ServicePackFiles
'
'--------------------------------------------------------------------------
folder = WINDIR & "\ServicePackFiles"
if fso.FolderExists(folder) then
CmdLine = "Rmdir " & folder
MyFile.WriteLine(CmdLine)
end If
'--------------------------------------------------------------------------
'
' Empty the directory \software distribution\download
'
'--------------------------------------------------------------------------
folder = WINDIR & "\softwaredistribution\download"
if fso.FolderExists(folder) then
CmdLine = "del " & folder & "\*.* /Q /F /A"
MyFile.WriteLine(CmdLine)
end If
'-------------------------------------------------------------------------
' END of the SCRIPT and RUN .bat
'-------------------------------------------------------------------------
MyFile.Close
Set MyFile = Nothing
Set fso = Nothing
Return = WshShell.Run ("c:\AdminServeurs\CmdLine.bat",10,TRUE) |
Partager