Page 1 of 1

BAT & Perfmon

Posted: Thu Jun 12, 2008 2:28 am
by Eric
Does anyone know if there is a way to use Batch files or CommandLine() to start performance monitoring (windows Run command perfmon)on the server, NOT TM1 Server with performance cubes. As always trying to see how many ways I can circumvent the IT department when executing new ETL's on Dev.

Re: BAT & Perfmon

Posted: Thu Jun 12, 2008 7:02 am
by Daniel Lennon
Hi Eric,

You could always use VB in Excel...

Sub PerfMon()
Shell "perfmon", 1
End Sub

Kind Regards,
Daniel.

Re: BAT & Perfmon

Posted: Thu Jun 12, 2008 7:39 am
by rossi
Hi Daniel
Do you have an example of the VB please?
thank you
Paolo
prossi45@hotmail.com

Re: BAT & Perfmon

Posted: Thu Jun 12, 2008 10:01 am
by Daniel Lennon
Sub PerfMon()
Shell "perfmon", 1
End Sub
Kind Regards,
Daniel.

Re: BAT & Perfmon

Posted: Thu Jun 12, 2008 10:08 am
by rossi
cheers for that
Paolo

Re: BAT & Perfmon

Posted: Mon Jun 16, 2008 12:11 pm
by Eric
I used the command line to open an excel file that when it opens it runs the perfmon shell and then closes the excel file. Works perfect thanks!

Ok dumb question time. :?

How do I stop the perfmon in VBA?

Re: BAT & Perfmon

Posted: Thu Jun 19, 2008 9:19 am
by Steve Rowe
A complete guess, did you try Shell "perfmon",0 ?

Re: BAT & Perfmon

Posted: Thu Jun 19, 2008 10:25 am
by Andy Key
Eric,

If you want to use the same Excel approach you can use:

Code: Select all

Sub ClosePerfMon()
   AppActivate "Performance"
   SendKeys "%{F4}", True
End Sub
Note: "Performance" is the title of the PerfMon window under XP, check that it is the same under your server OS, and %{F4} translates to Alt F4.

You need to be aware though, that if you have other foreground applications running on that server and one of those grabs the focus between the AppActivate and the SendKeys it will get the Alt F4 sent to it rather than to PerfMon.

Re: BAT & Perfmon

Posted: Thu Jun 19, 2008 12:42 pm
by Eric
Awesome!

Think I can use the same methodology to kill winzip after a backup? (If anyone doesn't know. If you call winzip via TI it will zip everythin, but it will not close after it is completed.

Re: BAT & Perfmon

Posted: Thu Jun 19, 2008 2:39 pm
by Andy Key
Eric,

Can you not use the WinZip command line interface (WZZIP)?

Re: BAT & Perfmon

Posted: Tue Jun 24, 2008 5:44 pm
by Mike Cowie
Just to add another command-line zipping utility to the list, I've had really good luck using 7ZIP, which is freeware:
http://www.7zip.com/

I haven't used it directly from TM1, but have done some extracting and zipping from other apps where a command-line EXE was needed.

Regards,