存档

文章标签 ‘批处理’

添加本地dns映射并启动internet访问的批处理

2010年1月11日 没有评论

在本地做测试或者域名解析没有生效的时候,弄出的一个小东西。可以自己用也可以给别人用,所有的情况我都遇到过。

@echo off
echo.
echo %windir%\system32\drivers\etc\hosts
echo.
echo.
echo *.*.*.* www.domain.com>>%windir%\system32\drivers\etc\hosts
echo.
echo *.*.*.* domain.com>>%windir%\system32\drivers\etc\hosts
echo.
cd %systemdrive%\Program Files\Internet Explorer
iexplore.exe http://www.baidu.com

    分类: 电脑知识 标签: , , ,

    自制清除系统垃圾的批处理命令

    2007年12月16日 没有评论

    把下面的代码存成.bat格式的文件,然后运行的时候双击运行就可以了.就可以删除系统的一些不需要的文件,或者安装程序的临时文件,以及浏览器产生的临时文件等等.

    @echo off
    echo 正在清除系统垃圾文件,请稍等......
    del /f /s /q %systemdrive%*.tmp
    del /f /s /q %systemdrive%*._mp
    del /f /s /q %systemdrive%*.log
    del /f /s /q %systemdrive%*.gid
    del /f /s /q %systemdrive%*.chk
    del /f /s /q %systemdrive%*.old
    del /f /s /q %systemdrive%recycled*.*
    del /f /s /q %windir%*.bak
    del /f /s /q %windir%prefetch*.*
    rd /s /q %windir%temp & md %windir%temp
    del /f /q %userprofile%cookies*.*
    del /f /q %userprofile%recent*.*
    del /f /s /q "%userprofile%Local SettingsTemporary Internet Files*.*"
    del /f /s /q "%userprofile%Local SettingsTemp*.*"
    del /f /s /q "%userprofile%recent*.*"
    echo 清除系统垃圾完成!
    echo. & pause