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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@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




















本文转自bard_zhang51CTO博客,原文链接: http://blog.51cto.com/timefiles/1724180,如需转载请自行联系原作者