Sign in with
Sign up | Sign in
Your question

How to not set the archive attribute when copying files

Last response: in Windows XP
Share
May 29, 2012 6:10:04 PM

Hello,

I would like to know how to not have the unzip operation set the archive attribute of the files being unzipped. I am using Windows XP Pro (service pack 2). The archive attribute being set creates some problem with an application which will detect this archive attribute ON and will attempt to automatically export the files with this attribute ON.
I believe that the XP Pro original zip utility (prior to Service Pack 2) used to not do this to the files being zip/unzipped.
May 29, 2012 6:43:13 PM



Try XP with SP3 installed because I have that and don't suffer the problem. Open a Command Prompt and type inattrib /? then look at the options and you'll find how to change the attribute. It may even work if you create a folder to store and put all future zips into and which has attribute A turned off by tying attrib -A {foldername} but experiment with ghe settings.



m
0
l
May 29, 2012 7:23:15 PM

Hello Saga Lout,

I appreciate your answer, however I can't upgrade these machines to Service Pack 3 now due to their software configuration (they are real process machines in a factory). This idea, however, appears great.
I am thinking about possibly write a VB script which will treat those files after unzipping and before restarting my machine's application (the one which will eventually resend these files to the Server).
I am posting this, just in case you might have had a similar experience or anyone else, Thanks.
m
0
l
Related resources
May 30, 2012 5:04:32 AM



You coul dwrite a script but I believe that if you dedicate a folder and set the attribute once only, then you need only to create a sub-folder within that folder as and when you download a new zip and ExtractTo that sub-folder, the attribute settings will apply.

m
0
l
May 30, 2012 11:56:52 AM

Saga Lout said:


You coul dwrite a script but I believe that if you dedicate a folder and set the attribute once only, then you need only to create a sub-folder within that folder as and when you download a new zip and ExtractTo that sub-folder, the attribute settings will apply.



This theory would work only if I was upgraded to Service Pack 3, correct?
m
0
l
May 30, 2012 5:06:15 PM




Service pack 3 is not to be feared. It is worth installing.

I don't know how to not set the archive attribute when copying files, but there is a little program you can install that works in the Windows Explorer context menu that will change attributes on a large scale within a folder. The program is "Attribute Changer" and it's free. Simply install and use Ctrl A (select all) to select all files in a folder and right-click, choose "Change Attributes" and un-check the archive attribute and all files will not have that set in a matter of seconds.

Get it
HERE.
m
0
l
May 30, 2012 5:38:42 PM

Not sure how to do it while unzipping, but for a plain copy, use xcopy /k to keep the attributes the same.
m
0
l
May 30, 2012 9:03:13 PM

tigsounds said:
Service pack 3 is not to be feared. It is worth installing.

I don't know how to not set the archive attribute when copying files, but there is a little program you can install that works in the Windows Explorer context menu that will change attributes on a large scale within a folder. The program is "Attribute Changer" and it's free. Simply install and use Ctrl A (select all) to select all files in a folder and right-click, choose "Change Attributes" and un-check the archive attribute and all files will not have that set in a matter of seconds.

Get it
HERE.


I appreciate your answer,

If I was fearing Service Pack 3 it is only for a reason of possibly interferring with another application running on these machines. It will first require some tests.
As today I have been pretty much doing what your little program is doing, meaning that I am selecting all files of the directory within the explorer then I show the properties, then click on advanced, then deselect the archive attribute and apply or Ok, this works.
My only concern with this, it is not always me doing it and some people can't do it right. This is why I wanted to automate this operation in order to eliminate the risk.
If this operation isn't done properly, another application system on my server is going to be bombarded with all of these files (the one with the A atrribute on) and it will choke!
Thanks for your time.
m
0
l
May 30, 2012 9:08:43 PM

Hawkeye22 said:
Not sure how to do it while unzipping, but for a plain copy, use xcopy /k to keep the attributes the same.


I have tried this and it still sets the A attribute on the copied file
m
0
l
May 31, 2012 12:08:11 PM

Sprinter said:
I have tried this and it still sets the A attribute on the copied file


Odd, I 've never had this problem. Are you sure the archive bit wasn't set before the xcopy? The /k flag is to keep attributes as is, not to reset the archive bit.
m
0
l
May 31, 2012 2:12:23 PM

Hawkeye22 said:
Odd, I 've never had this problem. Are you sure the archive bit wasn't set before the xcopy? The /k flag is to keep attributes as is, not to reset the archive bit.


Yes Sir, I have made sure to turn the A attribute Off before doing the copy like this: XCOPY /K test.txt testA.txt
Once I do this I have to answer a question about the 'testA.txt' to specify with 'F' that it is a file.
m
0
l
!