Windows 7 Batch file runs fine on command prompt but not through Windows Task Scheduler

  • Thread starter Thread starter OldeEnglishD
  • Start date Start date
O

OldeEnglishD

My batch file, containing MySql, runs fine thru command prompt but not as a scheduled task in Windows Task Scheduler.

The first two lines of the file run fine but the third line for MySql does not. Don't know if the problem is MySql or maybe security. I submitted this on the MySql forum as well.
Batch file is as follows:

@echo off
cd c:\program files\mysql\MySql Server 5.7\bin\
MySql -u%1 -p%2 -D%3 < %4


Error is 2 which is file not found

It is called thru scheduler as follows under the Actions tab:

Program Script: RestoreInvoices.bat
Add arguments (optional): "root" "xxxxx" "invoices_backup" "p:\InvoicesRestore.sql"
Start in (optional): C:\Users\akushner\

The first two lines in the batch file run just fine but it blows up on the third line (the MySql line). why? Just cannot run the batch file thru Windows Task scheduler. windows 7


Continue reading...
 
Back
Top