Windows – Task Scheduler – ‘Action “C:\Windows\SYSTEM32\cmd.exe” with return code 1’

Background

We are trying to schedule a script, but it is not doing anything.  It runs too quickly, does not come back with an error message, yet states that the task ran successfully.

 

Message

Task Scheduler successfully completed task "\HRDB\ExportDBScripts" , instance "{5592ba57-7cc0-4468-8418-3e9b2dbddafb}" ,action "C:\Windows\SYSTEM32\cmd.exe" with return code 1.

Review Task Log

In Task Scheduler, Review Task History

Reviewed the Task’s history:

TaskHistory-After

Explanation:

  1. Log Name : Microsoft-Windows-TaskScheduler/Operational
  2. Source = TaskScheduler
  3. Event ID = 201

 

In Windows Event Viewer, Review Task History

Launched Windows Event Viewer and navigated to :

\Microsoft
\Windows
\ TaskScheduler
\ Operational

And, here is what we saw.

Windows-EventLog-After

Explanation:

  1. Log Name : Microsoft-Windows-TaskScheduler/Operational
  2. Source = TaskScheduler
  3. Event ID = 201
  4. Task Category = Action Completed

 

Remediation

Edit Task

Let us make the necessary changes, which is to specify the Start folder.

Here are the steps:

  1. Select Task
  2. Right click on the selected task and choose Properties from the drop-down menu
  3. The Task Properties window appears
    • Choose the Actions tab
    • The actions for the task are displayed
  4. Choose the Edit button
  5. The “Edit Action” window appears
    • In our case the “Start-In” folder is empty
    • Please specify the Start-In folder

 

Action List

ListActions

Edit Action

EditAction-Before

 

Edit Action – After

EditAction - After - 0929AM

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s