Solved

task scheduler to display a log file once a day.

Posted on 2014-03-21
5
627 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 52

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 52

Expert Comment

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

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

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…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

810 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