-
Notifications
You must be signed in to change notification settings - Fork 931
Open
Labels
0 - TriagingIssue is accepted, but a milestone has yet to be added for the issue.Issue is accepted, but a milestone has yet to be added for the issue.BugIssues where something has happened which was not expected or intended.Issues where something has happened which was not expected or intended.
Description
What You Are Seeing?
When running refreshenv at the same time under multiple command prompt windows it tries to write _envset.tmp and _env.cmd but ends up in a race condition situation as the files are locked by other process. This is not an issue when running refreshenv manually but when automating things and optimizing the automation by parallelism.
What is Expected?
The temp files should be written with random file names.
How Did You Get This To Happen? (Steps to Reproduce)
Write a script which launches multiple command prompts and runs refreshenv on each.
@echo off
start cmd /k refreshenv
start cmd /k refreshenvOutput Log
Refreshing environment variables from registry for cmd.exe. Please wait...The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
C:\Users\Administrator\AppData\Local\Temp\_envset.tmp
C:\Users\Administrator\AppData\Local\Temp\_env.cmd
Finished..
jzabroski
Metadata
Metadata
Assignees
Labels
0 - TriagingIssue is accepted, but a milestone has yet to be added for the issue.Issue is accepted, but a milestone has yet to be added for the issue.BugIssues where something has happened which was not expected or intended.Issues where something has happened which was not expected or intended.