当前位置:网站首页>[batch dos-cmd command - summary and summary] - view or modify file attributes (attrib), view and modify file association types (Assoc, ftype)
[batch dos-cmd command - summary and summary] - view or modify file attributes (attrib), view and modify file association types (Assoc, ftype)
2022-07-07 00:57:00 【dssgresadfsrgre】
One 、 View or modify file properties ——ATTRIB
Execute the order first 【attrib /?】, See help information .
C:\Users\Administrator>attrib /?
Show or change file properties .
ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [+O | -O] [+I | -I] [+X | -X] [+P | -P] [+U | -U]
[drive:][path][filename] [/S [/D]] [/L]
+ Set properties .
- Clear properties .
R Read only file properties .
A Archive properties .
S System file properties .
H Hide file properties .
O Offline properties .
I No content index file properties .
X No clean file properties .
V Integrity properties .
P Fixed attribute .
U Non fixed attributes .
[drive:][path][filename]
Specify the properties of the file to process .
/S Process the current folder and all its subfolders
Matching files for .
/D Also handle folders .
/L Handling symbolic links and
Properties of the symbolic link target
C:\Users\Administrator>
example :
md autorun
attrib +a +s +h autorun
The above command will create a folder autorun, Then set it to archive 、 System 、 Hidden attribute
Two 、 View the file types associated with modifying file extensions ——assoc
2.1 Show command assoc Help for
Print assoc Help for , Carry out orders 【assoc /?】.
C:\Users\Administrator>assoc /?
Show or modify file extension associations
ASSOC [.ext[=[fileType]]]
.ext Specifies the file extension associated with the file type
fileType Specifies the file type associated with the file extension
type ASSOC Without parameters , Displays the current file association . If you only use file extensions
Call ASSOC, The current file association of that file extension is displayed . If not for
The file type specifies any parameters , The command deletes the association of file extensions .
C:\Users\Administrator>
2.2 Display the file types corresponding to all extensions
Execute the command without any parameters 【assoc】, Get the file types corresponding to all extensions , As shown below ( Only excerpts ).
C:\Users\Administrator>assoc
.3ds=Photoshop.3DSFileType.140
.3gp=WMP11.AssocFile.3GP
.AAC=WMP11.AssocFile.ADTS
.abr=Photoshop.BrushesFile
.csv=Excel.CSV
.dat=xmp.dat
.db=ANSYS 2020 R2 .db File
.doc=Word.Document.8
.dll=dllfile
.mp3=WMP11.AssocFile.MP3
.mp4=WMP11.AssocFile.MP4
.mpeg=WMP11.AssocFile.MPEG
.png=pngfile
.txt=txtfile
.xml=xmlfile
2.3 Displays the file type corresponding to the specified file extension
Execute the command with the extension parameter 【assoc .ext】, The file type corresponding to the extension will be displayed .
For example, to perform 【assoc .exe】, The return is 【.exe=exefile】, explain .exe The corresponding file type is exefile.
in addition .txt The file type of is txtfile, and .doc The file type of is Word.Document.8.
assoc .txt # Show .txt Representative ' file type ', Results show .txt=txtfile
assoc .doc # Show .doc Representative ' file type ', Results show .doc=Word.Document.8
3、 ... and 、 View the program associated with modifying the file extension ——ftype
3.1 View command ftype Help for
Execute the order first 【ftype /?】, View help information .
C:\Users\Administrator>ftype /?
Displays or modifies the file types used in file extension associations
FTYPE [fileType[=[openCommandString]]]
fileType Specify the file type to check or change
openCommandString Specify the open commands to use when calling such files .
type FTYPE Without parameters to display the currently defined open command string
file type .FTYPE When enabled with only one file type , It shows which file class
Type current open command string . If you do not specify ,
FTYPE Command will delete the open command string of that file type . In a
Within the open command string , Command string %0 or %1 Called by Association
Instead of the file name of .%* Get all the parameters ,%2 Get the first parameter ,
%3 Get a second , wait .%~n Get all the rest with nth Parameters begin
Parameters ;n It can be from 2 To 9 The number of . for example :
ASSOC .pl=PerlScript
FTYPE PerlScript=perl.exe %1 %*
Allows you to enable the following Perl Script :
script.pl 1 2 3
If you do not want to type an extension , Then type the following string :
set PATHEXT=.pl;%PATHEXT%
The script that is started is as follows :
script 1 2 3
C:\Users\Administrator>
3.2 Check the startup program corresponding to all file types
Execute without parameters ftype command , give the result as follows ( Incomplete ).
C:\Users\Administrator>ftype
Excel.CSV="D:\Program Files\Microsoft Office\Office16\EXCEL.EXE" /dde
Folder=%SystemRoot%\Explorer.exe
http="C:\Program Files\Internet Explorer\iexplore.exe" %1
https="C:\Program Files\Internet Explorer\iexplore.exe" %1
kugou="D:\Program Files (x86)\KuGou\KGMusic\KuGou.exe" "%1"
Python.ArchiveFile="C:\WINDOWS\py.exe" "%L" %*
Python.CompiledFile="C:\WINDOWS\py.exe" "%L" %*
Python.File="C:\WINDOWS\py.exe" "%L" %*
Python.NoConArchiveFile="C:\WINDOWS\pyw.exe" "%L" %*
Python.NoConFile="C:\WINDOWS\pyw.exe" "%L" %*
WinRAR="D:\Program Files\WinRAR\WinRAR.exe" "%1"
WinRAR.REV="D:\Program Files\WinRAR\WinRAR.exe" "%1"
WinRAR.ZIP="D:\Program Files\WinRAR\WinRAR.exe" "%1"
3.3 Check the startup program corresponding to the specified file type
Rule of grammar .
ftype filetype # There is no need to add a dot before the file type string
Carry out orders 【ftype exefile】, The result is 【exefile="%1" %*】.
Carry out orders 【ftype txtfile】, The result is 【txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1】.
3.4 Modify the startup program corresponding to the specified file type
Rule of grammar .
ftype filetype=openCommandString # There is no need to add a dot before the file type string
Ordinary users generally do not use this rule , Because the startup program string is too difficult to understand .
For the average user , The frequently used operation is nothing more than associating a certain extension with a certain file type , such as doc And word Application relevance , This is not necessary ftype Ordered , Use a command directly 【assoc .doc=Word.Document.8】 that will do .
3、 ... and 、windows The system opens the file process
When you double click on one .txt When you file ,windows Not based on .txt For direct judgment notepad.exe open .
But first by order 【assoc .txt】 The results of the implementation of 【.txt=txtfile】 Judge to know .txt Belong to txtfile file type ,
Call again txtfile Associated command line , That is to say 【txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1】 Corresponding program .
Four 、windows Restore file associations
4.1 except exe Program , Restore the association directly with the command
for example , It's on command 【assoc .txt=Word.Document.8】, Yes txt After the extension file changes the file type , To restore the original Association , You can use the command 【assoc .txt=txtfile】
4.2 about exe Program , Restoring associations requires .com
exe File is windows Executable files in the system , The file association determines the way the file is opened .
When we accidentally change exe After program association ,cmd The program cannot be opened normally .
How to recover correctly exe File Association ?
First, in the C:\WINDOWS\system32(64 position WOW64) In the directory cmd.exe, Select the file and press F2 key , Change the file name to cmd.com.
Then double click to execute cmd.com, Pop up command line window , Enter the command 【assoc .exe=exefile】 And return .
边栏推荐
- 新手如何入门学习PostgreSQL?
- Cross-entrpy Method
- Periodic flash screen failure of Dell notebook
- View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
- Advanced learning of MySQL -- basics -- multi table query -- subquery
- Part 7: STM32 serial communication programming
- pyflink的安装和测试
- Markov decision process
- Provincial and urban level three coordinate boundary data CSV to JSON
- 第四篇,STM32中断控制编程
猜你喜欢
Js+svg love diffusion animation JS special effects
Distributed cache
Deep understanding of distributed cache design
Dell笔记本周期性闪屏故障
Hero League | King | cross the line of fire BGM AI score competition sharing
第六篇,STM32脉冲宽度调制(PWM)编程
AI super clear repair resurfaces the light in Huang Jiaju's eyes, Lecun boss's "deep learning" course survival report, beautiful paintings only need one line of code, AI's latest paper | showmeai info
5种不同的代码相似性检测,以及代码相似性检测的发展趋势
Activereportsjs 3.1 Chinese version | | | activereportsjs 3.1 English version
深度学习之线性代数
随机推荐
What is time
Advanced learning of MySQL -- basics -- multi table query -- inner join
「精致店主理人」青年创业孵化营·首期顺德场圆满结束!
以机房B级建设标准满足等保2.0三级要求 | 混合云基础设施
Alexnet experiment encounters: loss Nan, train ACC 0.100, test ACC 0.100
Hero League | King | cross the line of fire BGM AI score competition sharing
Learn self 3D representation like ray tracing ego3rt
Part IV: STM32 interrupt control programming
深度学习之数据处理
Article management system based on SSM framework
stm32F407-------DAC数模转换
build. How to configure the dependent version number in the gradle file
Advanced learning of MySQL -- basics -- multi table query -- external connection
Address information parsing in one line of code
fastDFS数据迁移操作记录
Attention slam: a visual monocular slam that learns from human attention
Tencent cloud webshell experience
《安富莱嵌入式周报》第272期:2022.06.27--2022.07.03
【批处理DOS-CMD命令-汇总和小结】-字符串搜索、查找、筛选命令(find、findstr),Find和findstr的区别和辨析
第五篇,STM32系统定时器和通用定时器编程