Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to check and set Task Scheduler Log options and path using a script


Author: Nirmal Sharma MVP

View products that this article applies to.

Summary

The following knowledgebase will explain the methods you can use to check the Task Scheduler Log options and path on local and remote computer.

↑ Back to the top


More information

To check on local computer:

You can use the following methods:

  1. Connecting to Remote Registry Service
  2. Using a script

The first method is easy but includes a lot of efforts. You can navigate to the following location in registry after connecting to remote registry:

HKLM\Software\Microsoft\SchedulingAgent

The above registry key includes the following values in right pane:

��� LogPath������ REG_EXPAND_SZ��� %SystemRoot%\SchedLgU.Txt
��� TasksFolder REG_EXPAND_SZ��� %SystemRoot%\Tasks

To check on a Remote Computer:

You can use the below script to check the LogPath and Tasks Folder on a remote computer:

@echo off

Srvlist=C:\Temp\Srvlist.txt

Echo Computer Name, Log Path, Tasks Folder >> Result.csv

SET Log_Path=
SET Task_Fold=

For /F �Tokens=*� %%a In (%srvlist%) Do (

Set Comp_name=%%a

Set RegQry=�\\%%a\HKLM\Software\Microsoft\ShcedulingAgent�

REG.exe Query %RegQry% > CheckCC.txt

Find /i "LogPath" < CheckCC.txt > StringCheck.txt

FOR /f �Tokens=3� %%b in (CheckCC.txt) DO SET Log_Path=%%b

Find /i �TasksFolder� < CheckCC.txt > StringCheck.txt

FOR /f �Tokens=3� %%b in (CheckCC.txt) DO SET Task_Fold=%%b

Echo %Comp_name, %Log_Path%, %Task_Fold% >> Result.csv

)

The above script will check remote computer for two registry entries for Log Path and Tasks Folder and the results will be saved in a CSV format file.

↑ Back to the top


Properties

COMMUNITY SOLUTIONS CONTENT DISCLAIMER
MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.

↑ Back to the top


Community solutions content disclaimer

Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.

↑ Back to the top


Keywords: KB556022, kbhowto, kbpubtypecca, kbpubmvp

↑ Back to the top

Article Info
Article ID : 556022
Revision : 1
Created on : 9/26/2007
Published on : 9/26/2007
Exists online : False
Views : 520