Logman command is the solution for it.
let's have a look at the command syntax
This command is very helpful in performance automation scenario.
If performance monitoring counter name is test_perf_log
then start command will go as :-
logman start test_perf_log
on similar line stop command will go as:-
logman stop test_perf_log
For more detail jump to page :- http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nt_command_typeperf.mspx?mfr=true
let's have a look at the command syntax
Syntax Verbs
Logman [create {counter | trace} collection_name ] [start collection_name] [stop collection_name] [delete collection_name] [query {collection_name|providers}] [update collection_name]
Parameter details:-
create {counter | trace} collection_name : Creates collection queries for either counter or trace collections. You can use command line options to specify settings.
start collection_name : Starts the data collection query collection_name. Use this option to change from scheduled collections to manual ones. Use the update parameter in the command line with begin-time (-b), end-time (-e), or repeat-time (-rt) to reschedule collections.
stop collection_name : Stops the data collection query collection_name. Use this option to change from scheduled collections to manual ones. Use the update parameter in the command line with begin-time (-b), end-time (-e), or repeat-time (-rt) to reschedule collections.
delete collection_name : Deletes the data collection query collection_name. If the collection_name does not exist, you will receive an error.
query {collection_name|providers} : If no collection_name or providers are given, the status of all existing collection queries are displayed. Use collection_name to display the properties of a specific collection. To display the properties on remote computers, use the -s remote computer option in the command line. Use providers as your keyword in place of collection_name to display the registered providers installed on your local system. To list registered providers installed on the remote system, use the -soption in the command line.
update collection_name : Updates collection queries for counter and trace collections. For counter collections, modifications to the query will stop, and then restart the collections. For trace collections, use the following parameters in the command line to query without stopping the collection: -p provider [(flags[,flags ...])] Level, - max n, - o PathName, -ft mm:ss, or -fd.
This command is very helpful in performance automation scenario.
If performance monitoring counter name is test_perf_log
then start command will go as :-
logman start test_perf_log
on similar line stop command will go as:-
logman stop test_perf_log
For more detail jump to page :- http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nt_command_typeperf.mspx?mfr=true