Why Batch Process not working by Task Scheduler User Administrator?

0

I have a process for ETL, in a .bat file wich:

  • copy .xlsx file to a directory
  • open the excel file by progress
  • copy the information to progress database

When I run the .bat file by the user: TableauAdmin in the explorer:

  • it works fine !
  • TableauAdmin appears as the owner of the .log files

Then I created a scheduled task with the owner: TableauAdmin, and user to run the task: TableauAdmin, in Windows Server 2012. With the Highest privileges, wheter or not the user is loged ...

If I try to run the task I got this error:

Error occurred while accessing component property/method: open. Microsoft Excel cannot access the file 'd:\ses\dat\FacturaMes-240817.xlsx'. There are several possible reasons: Error code: 0x80020009 d:\ses\pro\sescargaexcelbd.p (5890)

And now, the owner of the .log files, is the user "Administrators".

Also, I am writing in the log files the %USERNAME% and appears "TableauAdmin"!!!

Is not working the progress-office-excel option by changing the account TableauAdmin to Administrators where is included TableauAdmin.

What to change to every thing works fine?

Today I changed the User that runs the Task to Administrators...

Now everything is working fine, but the user it is running it does not appears Administrators,

The User that appears running the process is another Administrator....

  • So the Excel File is owned by Administrators
  • And opened by Administrators
  • But is running by other Administrator, not TableauAdmin....

Why is running OK now?

batch-file
task
administrator
taskscheduler
asked on Stack Overflow Aug 24, 2017 by JWBG • edited Aug 29, 2017 by JWBG

1 Answer

0

Have a look at this link -> https://blogs.msdn.microsoft.com/dataaccesstechnologies/2012/12/19/error-microsoft-office-excel-cannot-access-the-file-while-accessing-microsoft-office-11-0-object-library-from-ssis/

For Windows 2008 Server x64: Create the following directory:

    C:\Windows\SysWOW64\config\systemprofile\Desktop

For Windows 2008 Server x86: Create the following directory:

    C:\Windows\System32\config\systemprofile\Desktop 
answered on Stack Overflow Oct 15, 2017 by Chris Richardson

User contributions licensed under CC BY-SA 3.0