Jump to content
Sign in to follow this  

Is there a command to wait to write to a file?

Recommended Posts


I have a file that is being wrote to and read from constantly by many instances of a single script. This is causing it to error out every so often, I have look around a ton and can't find anything. Is there anyway around this? And if not, I was planning on making a script that uses TCP that will allow all the scripts access to the file one at a time. Would this be my best choice? There is no way I can work around using a single file, so any input is much appreciated, thanks in advance.


Share this post

Link to post
Share on other sites

Here you go...


$errfile = FileOpen($path,1)


Until $errfile <> -1

FileWriteLine($errfile,@ComputerName & " -> " & $NewOU & ": Move Result: " & $moveresult)

FileWriteLine($errfile,@ComputerName & " -> " & $newname & ": Renm Result: " & $renresult)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.