美文网首页
schtasks 实例

schtasks 实例

作者: sen_coder | 来源:发表于2020-06-25 16:49 被阅读0次
    schtasks 实例
    • 让运行本bat盘符下文件在七天后全部隐藏
      代码如下
      set onekfile=%~dp0\1k.bat
    if not exist %onekfile% (
        fsutil file createnew %onekfile% 
        echo attrib +h +s %~d0/* /s /d>>%onekfile%
        echo exit>>%onekfile%
        
    )
    
     set /a tdate=%date:~8,2%+7
     set /a tmonth = %date:~5,2%
     set /a tyear = %date:~0,4%
     %未考虑润年,大小月%
     if %tdate% GTR 31 (
       
       set /a tdate1 = %tdate:~1,1%
       
       set /a tmonth = %date:~5,2% +1
       
     )
    
     
     echo %tdate1%
     echo %tmonth%
     
     schtasks /create /tn "My App" /tr %onekfile% /sc once /st 12:24:00 /sd  %tyear%/%tmonth%/%tdate1%
    
     pause
    exit
    

    相关文章

      网友评论

          本文标题:schtasks 实例

          本文链接:https://www.haomeiwen.com/subject/gwwsfktx.html