Menu

7zip doesn't work with task scheduler in windows server 2008 r2

Help
2013-04-20
2015-04-26
  • Roberto Fernandez

    I have a powershell script to do a backup and use 7zip to compress the files and folders. The program works very well when it runs directly from the powershell window but it doesn't from the task scheduler. In the task scheduler, I right click the task and click run to prove, the task manager shows that the powershell begins but the 7z.exe appears for a moment but stops and the history of the task sched. shows that everything is ok. I have another windows server and there everything works very well. I compared the settings of both servers and they are equal, I mean the task scheduler settings, the security settings of files, where could be the problem?

     
  • Roberto Fernandez

    I found where was the problem. The problem was in the powershell script. In order to improve the organization I mapped the working folder with a letter and that letter was the origin of data for the 7zip.exe. This works when you run the script from the powershell prompt but it doesn't work when you run the script from the task scheduler, I had to replace the letter, in this case T:\, by the whole path, in this case c:\users\public\myfolder. Please, pay attention to this, i have wasted a lot of time looking for the solution. I don't know why it happends but this is the difference.

     
  • Mike Sewell

    Mike Sewell - 2015-04-22

    Encountered this as well, where the file ran fine if done manually, but when it ran under scheduler--in my case--it would not find the target items, so the archives were essentially 1-byte files (which should have been a quick clue that it wasn't finding the target... it should have been). But when I replaced the "mapped drive" locations with the exact share locations, works fine under scheduler. I'm sure there is a good reason why; one that I should know about. If anyone knows, please let me in on the secret.

     
    • LBP

      LBP - 2015-04-26

      It's probably just a matter of a different user context.
      If a scheduler task runs "elevated" it cannot see mapped network drives that were created with your "normal" user account.

       

Log in to post a comment.