U盘文件变快捷方式--解决办法

将以下的代码copy到一个.txt文件中,然后将这个命名为go.bat,注意后缀名变为bat,也就是一个批处理。接着将go.bat文件copy到u盘中,双击运行即可。

@echo off
@echo 2017.10.28 by coordinate
@echo +-------------------------------------------------------------+
attrib -s -h *. /S /D
attrib +s +h System~1
attrib +s +h Recycled
attrib +s +h +a ntldr
@echo 完成!
@echo on

代码解析:

ATTRIB [+R | -R][+A | -A ] [+S | -S][+H | -H] [[drive:] [path] filename][/S [/D]]

+设置属性。
-清除属性。
R 只读文件属性。
A 存档文件属性。
S 系统文件属性。
H 隐藏文件属性。
[drive:][path][filename] 指定要处理的文件位置
/S 处理当前文件夹及其子文件夹中的匹配文件。
/D 处理文件夹。
attrib -s -h *. /S /D 清除当前文件夹及其子文件夹中的文件隐藏文件属性和系统文件属性。

attrib +s +h System~1 设置系统还原文件夹隐藏和系统文件属性

attrib +s +h Recycled 设置回收站隐藏和系统文件属性

attrib +s +h +a ntldr 设置ntldr文件的隐藏、系统和存档属性。ntldr是一个隐藏的,只读的系统文件,位置在系统盘的根目录,用来装载操作系统。


转自:https://blog.csdn.net/qq_17550379/article/details/78373073 

猜你喜欢

转载自blog.csdn.net/ling888666/article/details/84062526