locked
Windows Task Scheduler RRS feed

  • Question

  • 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 

    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

    Wednesday, October 17, 2018 9:22 PM

Answers

All replies

  • Might try asking over here.

    https://answers.microsoft.com/en-us/windows/forum/windows_7

    https://social.technet.microsoft.com/Forums/en-US/home?forum=w7itprogeneral

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Wednesday, October 17, 2018 11:58 PM
  • It failed before when I ran it on my C: Drive but not now due to other changes.

    It didn't recognize the mapped drive of p:

    ==================================================

    Mapped drives are a User Interface concept and are not available to background tasks like that. Access the target via UNC and make sure that the user that the task runs as has access to the target.

    Got the above from another post

    Thursday, October 18, 2018 2:26 PM