Strange behaviour of .txt , .hed and .ini files
            

Hi All,

I created a macro for copy-paste and cut-paste that helps auto task of moving / copying 5000+ files from source to destination. The tool worked perfectly fine for excel files but could not properly handle exceptions for .hed, .txt and .ini file. For this files (.txt , .hed, .ini ) , the macro failed to show the file status as "File in Use " when open. Instead it copied and moved the file from source to destination. I tried to check this manually, but  I noticed same thing that even in manual process, the system does not acknowledge that file is open and operation should not proceed.

Case 1.

I created one text file "test.txt". I opened this text file. The file was opened and i renamed the same open text file from "test.txt" to "tested.txt". i closed the open file. There was no warning message and operation executed successfully. The text file got renamed from "test.txt" to "tested.txt"

Case 2:

I created one text file "test.txt". I opened this text file. I copied this file and tried to paste on other folder path. It did not raise any warning message and the operation was successful. Same thing happens with files having extention .ini and .hed

Same thing does not happen with excel file. It raise exception and confirms with user saying the file is open. I believe in notepad also exception should be raised and confirmation should be taken from user when the file is in use.

Thanks,

Shamim


February 23rd, 2015 2:37am

Same thing does not happen with excel file. It raise exception and confirms with user saying the file is open. I believe in notepad also exception should be raised and confirmation should be taken from user when the file is in use.

You can not change that behavior, Excel locks the file, but Notepad doesn't.

It is up to you to use an application to open your text files locked, e.g. Word.

Andreas.

Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2015 3:14am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics