[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

task scheduler to display a log file once a day.

Posted on 2014-03-21
5
Medium Priority
?
666 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 1000 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 57

Assisted Solution

by:Joe Winograd, EE MVE 2015&2016
Joe Winograd, EE MVE 2015&2016 earned 1000 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 57

Expert Comment

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

872 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