当前位置:网站首页>[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 .
边栏推荐
- Mujoco second order simple pendulum modeling and control
- Advanced learning of MySQL -- basics -- multi table query -- joint query
- Data processing of deep learning
- 城联优品入股浩柏国际进军国际资本市场,已完成第一步
- Configuring the stub area of OSPF for Huawei devices
- equals()与hashCode()
- Advanced learning of MySQL -- basics -- basic operation of transactions
- Periodic flash screen failure of Dell notebook
- Value Function Approximation
- Leetcode(547)——省份数量
猜你喜欢
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
重上吹麻滩——段芝堂创始人翟立冬游记
深度学习之线性代数
建立自己的网站(17)
Installation and testing of pyflink
Dr selection of OSPF configuration for Huawei devices
做微服务研发工程师的一年来的总结
Threejs image deformation enlarge full screen animation JS special effect
Mujoco Jacobi - inverse motion - sensor
How to set encoding in idea
随机推荐
Explain in detail the implementation of call, apply and bind in JS (source code implementation)
Levels - UE5中的暴雨效果
dynamic programming
Equals() and hashcode()
threejs图片变形放大全屏动画js特效
Address information parsing in one line of code
【JokerのZYNQ7020】AXI_EMC。
省市区三级坐标边界数据csv转JSON
Part IV: STM32 interrupt control programming
Cross-entrpy Method
Advanced learning of MySQL -- basics -- transactions
OSPF configuration command of Huawei equipment
《安富莱嵌入式周报》第272期:2022.06.27--2022.07.03
Js+svg love diffusion animation JS special effects
Mujoco Jacobi - inverse motion - sensor
Use mujoco to simulate Cassie robot
Provincial and urban level three coordinate boundary data CSV to JSON
QT tutorial: creating the first QT program
腾讯云 WebShell 体验
第五篇,STM32系统定时器和通用定时器编程