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 a backroundrb scheduled task that takes quite a long time to run.
I have a .Net console App which using a scheduled event will start, call
I have a Stored procedure which schedules a job. This Job takes a lot
I have a console application that will be kicked off with a scheduler. If
I have been tasked with creating a program that will generate an amortization schedule.
I have a table which holds flight schedule data. Every schedule have an effective_from
I have code where I schedule a task using java.util.Timer . I was looking
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution

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.