Solved

task scheduler to display a log file once a day.

Posted on 2014-03-21
5
617 Views
Last Modified: 2014-04-09
I want to use task scheduler to display a log file once a day.
how do i set task scheduler to display just today's file.
the folder has a new log file with that days date on it
and keeps the old log files in the folder. The file is backup log file that can be open with notepad.
I ask this question before but the answer does not work for all my pc
I have 300 XP and win 7 that running Power Shell script will just not work.
I think I just need a Dot bat file

old ? link http://rdsrc.us/QiyMoI
0
Comment
Question by:PAP0028
  • 2
  • 2
5 Comments
 
LVL 13

Accepted Solution

by:
Santosh Gupta earned 250 total points
ID: 39945198
Hi,

Try below code... and run it as bat file.

modify the path and file type.

forfiles /p c:\temp\ /m *.txt /d 0 /c "cmd /c notepad @file"

Open in new window

0
 

Author Comment

by:PAP0028
ID: 39945366
I will need to test this on the weekend i will get back to you on Monday.
0
 
LVL 51

Assisted Solution

by:Joe Winograd, EE MVE
Joe Winograd, EE MVE earned 250 total points
ID: 39977439
Hi PAP0028,
The FORFILES command posted by Santosh is a native command in W7, but not in XP. For XP, it requires the Resource Kit. So if your XP computers don't have the Resource Kit on them, that code won't work. Here's some alternative code for a .BAT file that will run on any XP (and W7) machine:
echo off
for /f "delims=|" %%i in ('dir "C:\logs\*.txt" /b /o:d') do set LogFile=%%i
notepad %LogFile%

Open in new window

Of course, change "C:\logs\*.txt" to have the correct folder where your Cobian Backup log files are stored. Also, in order for this to work, the .BAT file must reside in the same folder as the Cobian Backup log files. Regards, Joe
0
 

Author Closing Comment

by:PAP0028
ID: 39988764
Thank you.
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 39988898
You're welcome. Regards, Joe
0

Featured Post

Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now