Strict Standards: Non-static method Settings::setHostName() should not be called statically in C:\website\www.networksteve.com\windows\_lib\AutoConfig.php on line 20

Strict Standards: Non-static method Settings::addHostAlias() should not be called statically in C:\website\www.networksteve.com\windows\_lib\AutoConfig.php on line 22

Strict Standards: Non-static method Settings::setSiteRoot() should not be called statically in C:\website\www.networksteve.com\windows\_lib\AutoConfig.php on line 28

Strict Standards: Non-static method Settings::setDsn() should not be called statically in C:\website\www.networksteve.com\windows\_site\Config.php on line 16

Strict Standards: Non-static method Settings::setTitle() should not be called statically in C:\website\www.networksteve.com\windows\_site\Config.php on line 19

Strict Standards: Non-static method Settings::setDescription() should not be called statically in C:\website\www.networksteve.com\windows\_site\Config.php on line 20

Strict Standards: Non-static method Settings::setSiteRoot() should not be called statically in C:\website\www.networksteve.com\windows\_site\Config.php on line 24

Strict Standards: Non-static method Settings::setShowDeleted() should not be called statically in C:\website\www.networksteve.com\windows\_site\Config.php on line 31

Strict Standards: Non-static method Settings::setRecentTopicsDuration() should not be called statically in C:\website\www.networksteve.com\windows\_site\Config.php on line 36

Strict Standards: Non-static method Settings::test() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Init.php on line 28

Strict Standards: Non-static method Skin::test() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Init.php on line 29

Strict Standards: Non-static method Settings::getSkin() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Skin.php on line 102

Strict Standards: Non-static method Settings::getSiteRoot() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Init.php on line 32

Strict Standards: Non-static method Settings::getDsn() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Init.php on line 35

Strict Standards: Non-static method Form::field() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Init.php on line 39

Strict Standards: Non-static method Form::fieldExists() should not be called statically, assuming $this from incompatible context in C:\website\www.networksteve.com\windows\_lib\Entity\User.php on line 92

Strict Standards: Non-static method Form::fieldExists() should not be called statically in C:\website\www.networksteve.com\windows\topic.php on line 15

Strict Standards: Non-static method Form::field() should not be called statically in C:\website\www.networksteve.com\windows\topic.php on line 17

Strict Standards: Non-static method Settings::getShowDeleted() should not be called statically, assuming $this from incompatible context in C:\website\www.networksteve.com\windows\_lib\Entity\Topic.php on line 138

Strict Standards: Non-static method Entity_Post::queryPosts() should not be called statically in C:\website\www.networksteve.com\windows\topic.php on line 21

Strict Standards: Non-static method Settings::getShowDeleted() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Entity\Post.php on line 111

Strict Standards: Non-static method Skin::showHeader() should not be called statically in C:\website\www.networksteve.com\windows\topic.php on line 23

Strict Standards: Non-static method Skin::includeFile() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Skin.php on line 46

Strict Standards: Non-static method Settings::getSkin() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Skin.php on line 91
How to log a process/application start/exit in event viewer? (Network Steve Forum)
How to log a process/application start/exit in event viewer?
Since you are using Windows 7 you could consider using a PowerShell Cmdlet for this: write-eventlog -computername Server01 -logname Application -source MyApp -eventID 3001 -message "MyApp added a user-requested feature to the display." For more information have a look here: http://technet.microsoft.com/en-us/library/dd347687.aspx You could execute the PowerShell command from batch by calling PowerShell.exe to execute the Cmdlet.
April 19th, 2012 7:26am

I was wondering how to log a process/application start/exit in event viewer? I know services are logged but applications are not. I need to run a program (or a batch file) after another program/process has been closed. I have so far concluded that you should log the process in event viewer/application log and then it would be easy to create a task for the batch file to run based on log id. An alternative I already use is a batch file / task that runs every say, 10 minutes and checks if a process is running; if it is it runs something, if it isn't it runs something else: tasklist /FI "IMAGENAME eq xbmc.exe" | find /i "xbmc.exe" rem echo %errorlevel% if not errorlevel 1 goto progon : progoff run command : progon run different command But this doesn't work in my case because I want to run the batch file only *once* after the process has stopped - the above solution runs it multiple times, ie every 10 minutes. I was wondering if someone from the forum has found any answer to this. I haven't posted in the answers forum (too general) but I'm not a programmer either, apart from being able to work with batch files...
Free Windows Admin Tool Kit Click here and download it now
April 19th, 2012 10:09pm

Since you are using Windows 7 you could consider using a PowerShell Cmdlet for this: write-eventlog -computername Server01 -logname Application -source MyApp -eventID 3001 -message "MyApp added a user-requested feature to the display." For more information have a look here: http://technet.microsoft.com/en-us/library/dd347687.aspx You could execute the PowerShell command from batch by calling PowerShell.exe to execute the Cmdlet.
April 20th, 2012 12:11am


Strict Standards: Non-static method Settings::getRecentTopicsLimit() should not be called statically, assuming $this from incompatible context in C:\website\www.networksteve.com\windows\_lib\Entity\Topic.php on line 120

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics

Strict Standards: Non-static method Skin::showFooter() should not be called statically in C:\website\www.networksteve.com\windows\topic.php on line 119

Strict Standards: Non-static method Skin::includeFile() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Skin.php on line 56

Strict Standards: Non-static method Settings::getSkin() should not be called statically in C:\website\www.networksteve.com\windows\_lib\Skin.php on line 91