濮阳杆衣贸易有限公司

主頁 > 知識庫 > vbs 定時刪除功能實現代碼

vbs 定時刪除功能實現代碼

熱門標簽:除了地圖標注還有這種生意嗎 齊齊哈爾高德地圖標注店 哪里有便宜的地圖標注公司 東營快遞外呼系統(tǒng) 百度地圖標注點距離代碼 地圖標注政府哪個部門管 如何用機器人進行電銷 神行者美術館地圖標注 佛山真人電銷機器人廠家

參考代碼一:

復制代碼 代碼如下:

Function DeleteLog( )
    Dim objFSO, objFolder, strPath, targetFSO, subFSO, DirPath  
    DirPath = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path"\Log\"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set targetFSO =  objFSO.GetFolder(DirPath)
    Set subFSO = targetFSO.SubFolders

    For Each subFolder in SubFSO
If DateDiff("d", subFolder.name, date)>3 Then
    strPath = DirPathsubFolder.name
    objFSO.DeleteFolder(strPath)
    End If
    Next
End Function
Call DeleteLog( )
這樣在task Schdeuler里面schedule我的vbs程序就沒有報錯啦。撒花,結貼~~

參考代碼二:

復制代碼 代碼如下:

Dim dqxs, dqrq, szxs, szfz, dqml, datp
Dim jclb
Dim c
dim d
'=========================================================
datp = "F:"
szxs = "7:00:"
wjml = datp "\DVRDat\"
sykj = 20000000000 '20個G
dqml = left(wscript.scriptfullname,instrrev(wscript.scriptfullname,"\")-1)
jclb = "ServicesManager.exe,PD_Server.exe,SpeedServer.exe,CoreServer.exe,DownloadSVC.exe,ManagerConsole.exe,Gptsvr.exe,HintAMProxy.exe,FileServer.exe,CleanDisk.exe,GetNetData.exe,SGUClient.exe,SGUServer.exe,"
set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = Wscript.CreateObject("Scripting.FileSystemObject")
'=========================================================
if fso.GetDrive(datp).FreeSpace sykj then call cprlql
do
    If InStr(time, szxs) > 0 Then
        if fso.GetDrive(datp).FreeSpace sykj then call cprlql
    end if
    WScript.Sleep(60*1000)
loop

getfso=fso.GetFolder("c:\\windows").DateCreated
'===========================================================
Function cprlql
    Dim strline, scml
    WshShell.run "cmd /c dir " wjml " /ad /b /tc>c:\dir.log",0
    if fso.FileExists("c:\dir.log") then
        Set objFile = fso.OpenTextFile("c:\dir.log")                
        do until objFile.atendofstream
            strline = objFile.readline
            scml = wjml strline
            WshShell.run "cmd /c rd /s /q " scml,0
            for i = 1 to 20
                if fso.GetDrive(datp).FreeSpace > sykj then exit Function
                if fso.FolderExists(scml) then
                    WScript.Sleep(1000)
                else
                    exit for
                end if
            next
            if fso.GetDrive(datp).FreeSpace > sykj then exit Function
        loop
    end if
End Function

您可能感興趣的文章:
  • php定時刪除文件夾下文件(清理緩存文件)
  • 使用mysql事件調度器定時刪除binlog
  • 使用vbs腳本定時刪除N天前的文件
  • Windows和Linux下定時刪除某天前的文件的腳本
  • Shell定時刪除指定時間之前的文件
  • 定時刪除一個文件夾內的所有子文件夾和文件的方法

標簽:湖州 西安 文山 鶴壁 ???/a> 四平 銅川 邢臺

巨人網絡通訊聲明:本文標題《vbs 定時刪除功能實現代碼》,本文關鍵詞  vbs,定時,刪除,功能,實現,;如發(fā)現本文內容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內容系統(tǒng)采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《vbs 定時刪除功能實現代碼》相關的同類信息!
  • 本頁收集關于vbs 定時刪除功能實現代碼的相關信息資訊供網民參考!
  • 推薦文章
    平舆县| 德化县| 淳安县| 广安市| 临湘市| 乐安县| 连云港市| 东台市| 邯郸市| 铅山县| 秦安县| 文登市| 达州市| 丹寨县| 都安| 深泽县| 龙胜| 成安县| 武汉市| 喜德县| 高雄县| 临夏市| 贵南县| 南川市| 平武县| 宁乡县| 法库县| 比如县| 泗水县| 孟津县| 渝北区| 鄂伦春自治旗| 龙岩市| 安康市| 嘉善县| 南雄市| 阳高县| 陇川县| 阿合奇县| 二连浩特市| 卢氏县|