清除 Windows 中的存档位 [英] clear the archive bit in windows

查看:40
本文介绍了清除 Windows 中的存档位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试清除 Windows 7 64 位中某些文件中的存档位.我试过代码:

I am trying to clear the archive bit in some files in windows 7 64bit. I have tried the code:

atrrib -a * /s

我得到的错误:'atrrib' 未被识别为内部或外部命令,可运行的程序或批处理文件.

The error I get: 'atrrib' is not recognized as an internal or external command, operable program or batch file.

我有一个小的 java 代码正在浏览文件.如果有办法在java中做到这一点会更可取.

I am having a small java code going through the file. If there is a way to do it in java would be preferable.

推荐答案

在 Java7 中你可以这样做:

In Java7 you can do this:

File theFile = new File("c:/foobar.txt");
Path file = theFile.toPath();
Files.setAttribute(file, "dos:archive", false);

这篇关于清除 Windows 中的存档位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆