PC Review


Reply
Thread Tools Rate Thread

Can I write to the Applications Log from the command line?

 
 
ToddAndMargo
Guest
Posts: n/a
 
      22nd Apr 2009
Hi All,

Can I write to the Applications Log from the command
line (batch file)?

Many thanks,
-T
 
Reply With Quote
 
 
 
 
Jon Wallace
Guest
Posts: n/a
 
      23rd Apr 2009
Hi Todd,

I don't believe you can straight from the command processor without an
external tool. You can in VBScript quite easily and therefore you could
call that script (with parameters) from the command line.

Have a look at this -
http://www.mcotis.com/scripting/wind...log_batch_file - pretty clear
explanation of doing it.

Good Luck!
Jon

www.insidetheregistry.com

---

"ToddAndMargo" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi All,
>
> Can I write to the Applications Log from the command
> line (batch file)?
>
> Many thanks,
> -T


 
Reply With Quote
 
Tim Meddick
Guest
Posts: n/a
 
      23rd Apr 2009
Yes, download the command-line tool: logevent.exe from:

http://www.dynawell.com/download/Res...T/logevent.zip

....you can then use this from a batchfile.

--

Cheers, Tim Meddick, Peckham, London.


"ToddAndMargo" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi All,
>
> Can I write to the Applications Log from the command
> line (batch file)?
>
> Many thanks,
> -T



 
Reply With Quote
 
ToddAndMargo
Guest
Posts: n/a
 
      23rd Apr 2009
Tim Meddick wrote:
> Yes, download the command-line tool: logevent.exe from:
>
> http://www.dynawell.com/download/Res...T/logevent.zip
>
> ...you can then use this from a batchfile.
>

Hi John and Tim,

Thank you!

-T
 
Reply With Quote
 
ToddAndMargo
Guest
Posts: n/a
 
      23rd Apr 2009
Tim Meddick wrote:
> Yes, download the command-line tool: logevent.exe from:
>
> http://www.dynawell.com/download/Res...T/logevent.zip
>
> ...you can then use this from a batchfile.
>



Usage: Z:\home\CDs\Windows\FileSystem\LogEvent\LogEvent.exe [-m
\\MACHINENAME] [-s SIWEF] [-c CategoryNumber] "Event Text"
Severity is one of (S)uccess, (I)nformation, (W)arning, (E)rror or
(F)ailure.

Which one of these writes to the "Applications" log?

LogEvent -m \\%machinename% -s S -c ????? "backup successful"

Me thinks it is the "CatagoryNumber", as I have no idea what
that is.

-T
 
Reply With Quote
 
Tim Meddick
Guest
Posts: n/a
 
      23rd Apr 2009
If you just want an event in the 'Applications' section, then have the
command:

logevent.exe "Successfully Backed up at: %TIME%"

Will produce a USER EVENT in APPLICATION LOG with the information:

Successfully Backed up at: 21:45:54.89

.....appended to it in the description section of the events 'properties'
(the time here is just an example: by putting the call for the variable
%TIME% in the command-line the current time will be appended to the output)

--

Cheers, Tim Meddick, Peckham, London.


"ToddAndMargo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Tim Meddick wrote:
>> Yes, download the command-line tool: logevent.exe from:
>>
>> http://www.dynawell.com/download/Res...T/logevent.zip
>>
>> ...you can then use this from a batchfile.
>>

>
>
> Usage: Z:\home\CDs\Windows\FileSystem\LogEvent\LogEvent.exe [-m
> \\MACHINENAME] [-s SIWEF] [-c CategoryNumber] "Event Text"
> Severity is one of (S)uccess, (I)nformation, (W)arning, (E)rror or
> (F)ailure.
>
> Which one of these writes to the "Applications" log?
>
> LogEvent -m \\%machinename% -s S -c ????? "backup successful"
>
> Me thinks it is the "CatagoryNumber", as I have no idea what
> that is.
>
> -T



 
Reply With Quote
 
ToddAndMargo
Guest
Posts: n/a
 
      23rd Apr 2009
Tim Meddick wrote:
> If you just want an event in the 'Applications' section, then have the
> command:
>
> logevent.exe "Successfully Backed up at: %TIME%"
>
> Will produce a USER EVENT in APPLICATION LOG with the information:
>
> Successfully Backed up at: 21:45:54.89
>
> ....appended to it in the description section of the events 'properties'
> (the time here is just an example: by putting the call for the variable
> %TIME% in the command-line the current time will be appended to the output)
>


Thank you!
 
Reply With Quote
 
Tim Meddick
Guest
Posts: n/a
 
      23rd Apr 2009
You are most welcome.

--

Cheers, Tim Meddick, Peckham, London.


"ToddAndMargo" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Tim Meddick wrote:
>> If you just want an event in the 'Applications' section, then have the
>> command:
>>
>> logevent.exe "Successfully Backed up at: %TIME%"
>>
>> Will produce a USER EVENT in APPLICATION LOG with the information:
>>
>> Successfully Backed up at: 21:45:54.89
>>
>> ....appended to it in the description section of the events 'properties'
>> (the time here is just an example: by putting the call for the variable
>> %TIME% in the command-line the current time will be appended to the
>> output)
>>

>
> Thank you!



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
launching many applications from command line Maurice Windows XP General 2 11th Jan 2007 01:05 AM
command line compiling of .net web applications =?Utf-8?B?ZG1n?= Microsoft Dot NET 0 25th Mar 2005 06:55 PM
uninstall applications from command line =?Utf-8?B?Q1A=?= Microsoft Windows 2000 1 1st Feb 2005 01:12 AM
Running VB.net applications at command line Atley Microsoft VB .NET 1 10th Feb 2004 03:59 PM
Building .net applications from command line Evgeniy Microsoft Dot NET 2 18th Sep 2003 11:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:46 PM.