您的位置:首页 > 其它

脚步创建windows计划任务

2015-12-16 11:26 302 查看
此脚本用于在windows平台使用脚步创建任务计划,以下是我实际工作中的一个脚步,有200台服务器需要配置,所以写了此脚本用于减少工作量

@echo off
color 0a
title Change profman
echo ★☆ ★☆★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★☆★
echo ★☆ ★☆★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★☆★
echo.★☆                                                      ☆★
echo.★☆    win7以上系统请右键点击此文件“以管理员省份运行”  ☆★
echo.★☆           正在执行,请稍等......                     ☆★
echo ★☆                                                      ☆★
echo.★☆                                                      ☆★
echo ★☆ ★☆★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★☆★
echo ★☆ ★☆★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★☆★
echo "添加任务计划,开机触发及每天00:00触发"
echo “Logman start Perf-20Second” > c:\performance.bat
schtasks /create /tn "performanceonstart" /ru SYSTEM /tr c:\performance.bat /sc onstart
schtasks /create /tn "performancedaily" /ru SYSTEM /tr c:\performance.bat /sc daily /st 00:00:00
echo "修改性能监控单个文件最大限制为1GB"
Logman.exe update counter Perf-20Second -f bincirc -max 1024 -c "\LogicalDisk(*)\*" "\Memory\*" "\Network Interface(*)\*" "\Paging File(*)\*" "\PhysicalDisk(*)\*" "\Server\*" "\System\*" "\Process(*)\*" "\Processor(*)\*" "\Cache\*" -si 00:00:20 -o C:\PerfMonLogs\Perf-20Second.blg
echo "移除开机启动项"
del  C:\"Documents and Settings"\"All Users"\"「开始」菜单"\程序\启动\Procmon.bat
del  C:\"Documents and Settings"\"All Users"\"「开始」菜单"\程序\启动\start-performan.bat
del  C:\ProgramData\Microsoft\Windows\"Start Menu"\Programs\Startup\Procmon.bat
del  C:\ProgramData\Microsoft\Windows\"Start Menu"\Programs\Startup\start-performan.bat
del  C:\"Documents and Settings"\"osmaster.CICEXTERNA"L\"「开始」菜单"\程序\启动\Procmon.bat
del  C:\"Documents and Settings"\"osmaster.CICEXTERNAL"\"「开始」菜单"\程序\启动\start-performan.bat
del  C:\Users\osmaster\AppData\Roaming\Microsoft\Windows\"Start Menu"\Programs\Startup\Procmon.bat
del  C:\Users\osmaster\AppData\Roaming\Microsoft\Windows\"Start Menu"\Programs\Startup\start-performan.bat
pause


本文出自 “汜水流年_” 博客,请务必保留此出处http://timefiles.blog.51cto.com/8475652/1724180
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: