windows attrib -s -r -h /s /d 不被识别为内部或外部命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19652411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:01:49  来源:igfitidea点击:

attrib -s -r -h /s /d is not recognized as internal or external command

windowsattributescommand-prompt

提问by kimiberi

I just wanna ask about this problem.

我就是想问这个问题。

I want to retrieve my files on my flash drive and then I tried this one:

我想在我的闪存驱动器上检索我的文件,然后我尝试了这个:

-s -r -h /s /d 

but the result is:

但结果是:

'-s' is not recognized as an internal or external command,
operable program or batch file.

How can I solve this one ?

我该如何解决这个问题?

回答by Gagan Sopori

Try changing the environment variables :-

尝试更改环境变量:-

  1. Right click My Computer> Properties> Advanced System Settings.
  2. In the Advanced System Settings Tab, click on Environment variablesand look for Pathin System variables
  3. Click Editand add C:\Windows\System32;at the end of the string.MAKE SURE YOU DON'T DELETE THE REST OF THE STRING.
  1. 右键单击“我的电脑”>“属性”>“高级系统设置”。
  2. 在高级系统设置选项卡中,单击环境变量并在系统变量中查找 路径
  3. 单击编辑并添加C:\Windows\System32;在字符串的末尾。确保您没有删除字符串的其余部分。

回答by Andrew Marais

For a once off attrib call you can use:

对于一次性 attrib 调用,您可以使用:

C:\Windows\System32\attrib.exe

Or you can change directory first and add the path in the parameters:

或者您可以先更改目录并在参数中添加路径:

cd C:\Windows\System32\

then

然后

attrib.exe -s -r -h "d:\file1.txt" /s /d