TomCat Posted June 20, 2010 Posted June 20, 2010 Hi I have following Problem. I need to write some text into a file that is opened by an other process. If I try to write into the file like this: $file = FileOpen("test.txt", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, "Line1") FileWrite($file, "Still Line1" & @CRLF) FileWrite($file, "Line2") FileClose($file) I get error Unable to open file. If I use iniwrite for same file i can write into the file. How can i force FileOpen now to open it for write into the file even if other process is writing to it? Or is their a way to unlock the other file with autoit? I hope someone here can help me
Mat Posted June 20, 2010 Posted June 20, 2010 http://msdn.microsoft.com/en-us/library/aa365715(VS.85).aspx Not sure if that will work or not. AutoIt Project Listing
TomCat Posted June 20, 2010 Author Posted June 20, 2010 Hi tnx for the answer but no doesnt work Any else ideas?
KaFu Posted June 20, 2010 Posted June 20, 2010 Take a look at this thread, at least two different approaches (au3 dllcall or PSTools) are described there... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
TomCat Posted June 21, 2010 Author Posted June 21, 2010 does not work too :-/ looks like only way is to use unlocker with commandline in a script.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now