• 批处理清理vc++共工程


    @echo off
    
    echo ----------------------------------------------------
    echo By ahy
    echo Press key to choise delete files or dir ...
    echo key 1 for delete temp file by suffix,eg: *.sdf *.obj *.ilk
    echo key 2 for delete project's setting files,eg: *.aps *.suo *.opt 
    echo key 3 for delete dir, eg: ipch
    echo key 4 equal like key1 key2 key3
    echo ----------------------------------------------------
    echo Press any key to delete all files with ending: 
    echo *.aps *.idb *.ncp *.obj *.pch *.tmp *.sbr
    echo *.tmp *.pdb *.bsc *.ilk *.res *.ncb *.opt
    echo *.suo *.manifest *.dep
    echo There are Visual C++ and Visual Studio junk
    echo ----------------------------------------------------
    
    
    :start
    :: configuration
    set strTempFile=*.res *.idb *.exp *.obj *.pch *.ilk *.sdf *.suo *.log *.tlog *.lastbuildstate *.VC.db *.bsc *.sbr *.tmp *.dep *.pdb
    set strProFile=*.aps *.clw *.ncb *.opt *.plg
    set strDelDir=ipch Pdb .vs
    
    set delAllFlag=0
    set c=
    set /p c=[1.del tmpfile 2.del profile 3.del ipch dir 4.del all ignore] 
    
    
    if "%c%"=="  "  goto :start
    if "%c%"==" "  goto :start
    if "%c%"=="" (
     goto :start
    )
    
    if /i %c%==1 (goto lbDelTempFile)
    if /i %c%==2 (goto lbDelProFile)
    if /i %c%==3 (goto lbDelDir)
    if /i %c%==4 (goto lbDelAllIgnore)
    if /i %c%==5 (goto lbTest)
    if "%c%"=="q" (exit) else (goto :start)
    
    :lbDelTempFile
    echo 【1】begin delete files: %strTempFile%
    
    :splitTempFile
    
    for /f "tokens=1,* delims= " %%i in ("%strTempFile%") do (
    
        if exist %%i (
        echo exist %%i file delete ...
        del /F /S /Q %%i
        ) else ( 
        echo no exist %%i file, recursion ...
        del /F /S /Q %%i
        )
        set strTempFile=%%j
    )
    if not "%strTempFile%"=="" goto splitTempFile
    if %delAllFlag%==1 (
       set delAllFlag=2
       goto lbDelProFile
    )
    goto start
    
    
    :lbDelProFile
    echo 【2】begin delete files: %strProFile%
    :splitProFile
    for /f "tokens=1,* delims= " %%i in ("%strProFile%") do (
        if exist %%i (
        echo exist %%i file delete ...
        del /F /S /Q %%i
        ) else ( 
        echo no exist %%i file, recursion ...
        del /F /S /Q %%i
        )
        set strProFile=%%j
    )
    if not "%strProFile%"=="" goto splitProFile
    if %delAllFlag%==2 (
       set delAllFlag=3
       goto lbDelDir
    )
    goto start
    
    :lbDelAllIgnore
    set delAllFlag=1
    goto lbDelTempFile
    
    
    :lbDelDir
    echo 【3】begin delete dir: %strDelDir%
    
    :splitDelDir
    for /f "tokens=1,* delims= " %%i in ("%strDelDir%") do (
        if exist %%i (
        echo rm %%i ...
        rd /s /q %%i
        ) else ( 
        echo no exist %%i dir
        )
        set strDelDir=%%j
    )
    if not "%strDelDir%"=="" goto splitDelDir
    goto start
    
    
    
    :lbTest
    if exist *.ncb (
    echo exist ncb file.
    ) else ( 
    echo no exist ncb file!
    )
    
    if exist *.ncbs (
    echo exist ncbs file.
    ) else ( 
    echo no exist ncbs file!
    )
    
    if exist *.ncbl (
    echo exist ncbl file.
    ) else ( 
    echo no exist ncbl file!
    )
    
    if exist *.lncb (
    echo exist lncb file.
    ) else ( 
    echo no exist lncb file!
    )
    
    if exist *.sncb (
    echo exist sncb file.
    ) else ( 
    echo no exist sncb file!
    )
    pause>nul
    goto start
    
    
    :end
    echo 直接回车了
    pause
  • 相关阅读:
    mysql TO_DAYS()函数
    MySQL year函数
    protobuff java 包编译(Windows)
    苹果笔记本只有电源键能用的解决办法
    linux普通用户获取管理员权限
    linux用户管理
    基于ASIHTTPRequest封装的HttpClient
    Object-C 多线程中锁的使用-NSLock
    appstore 上传需要的icon
    iPhone之IOS5内存管理(ARC技术概述)
  • 原文地址:https://www.cnblogs.com/zhangmo/p/16167330.html
Copyright © 2020-2023  润新知