Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4247528
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:07:09+00:00 2026-05-21T04:07:09+00:00

I have scheduled two powershell scripts as tasks to run at 00:00. This morning

  • 0

I have scheduled two powershell scripts as tasks to run at 00:00.

This morning I checked the event log and found that one of the scripts failed with the following exception:

Failure. The error was: ‘Failed to
create log entry in:
‘C:\Users\SPSETU~1\AppData\Local\Temp\PowerShellLog.txt’.
The error was: ‘The process cannot
access the file
‘C:\Users\SPsetupAdmin\AppData\Local\Temp\PowerShellLog.txt’
because it is being used by another
process.’.’.

  • Can be the problem related to logs? Both the scripts are using the write-log function (see poshcode.org) and log in the windows event log with the same id.
  • Do you know any known conflict among powershell scripts as scheduled tasks?
  • Do I have to execute tasks one a time?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:07:09+00:00Added an answer on May 21, 2026 at 4:07 am

    Well, since you simultaneously try to write to the same file from two different processes you can expect the above error.

    Powershell has the same restrictions as any application or program; in this case file write-locks. I don’t think there are any “special” restrictions on Powershell scripts as scheduled tasks.

    I would either see to that the commands you want to execute uses unique log files (if running them simultaneously is your top priority), or put the commands in the same script and execute this as a scheduled task (if getting everything in one log is your top priority).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two sql script file which are to be scheduled as windows tasks.
I have some NSViews that I'm putting in one of two layouts depending on
I have this two sharepoint web application that resides on the same server with
I have two background services in my application that are scheduled at regular intervals
I have two tables: a schedule table that contains information about how an employee
I have a scheduled task that is very IO intensive (deleting hundreds of thousands
I have a scheduled task running on a Windows Server 2008 R2 that is
I have an SQL script which creates a scheduled event: CREATE EVENT Daily_1200PM SCHEDULE
I have a job stored on a database, scheduled to run every day. But
I have a console app that's geared to be automatically ran as a Scheduled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.