当前位置:网站首页>[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 autorunThe 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=xmlfile2.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 .
边栏推荐
- dynamic programming
- Js+svg love diffusion animation JS special effects
- 省市区三级坐标边界数据csv转JSON
- Chapter 5 DML data operation
- 【批处理DOS-CMD命令-汇总和小结】-字符串搜索、查找、筛选命令(find、findstr),Find和findstr的区别和辨析
- Learn to use code to generate beautiful interface documents!!!
- Part IV: STM32 interrupt control programming
- Chenglian premium products has completed the first step to enter the international capital market by taking shares in halber international
- 【JokerのZYNQ7020】AXI_ EMC。
- Attention SLAM:一種從人類注意中學習的視覺單目SLAM
猜你喜欢

筑梦数字时代,城链科技战略峰会西安站顺利落幕

Alexnet experiment encounters: loss Nan, train ACC 0.100, test ACC 0.100

Learn to use code to generate beautiful interface documents!!!

ZYNQ移植uCOSIII
深入探索编译插桩技术(四、ASM 探秘)

Stm32f407 ------- SPI communication

Dell Notebook Periodic Flash Screen Fault

Zynq transplant ucosiii

Stm32f407 ------- DAC digital to analog conversion

Linear algebra of deep learning
随机推荐
Dell筆記本周期性閃屏故障
Zabbix 5.0:通过LLD方式自动化监控阿里云RDS
Leetcode(547)——省份数量
接口(接口相关含义,区别抽象类,接口回调)
Lombok 同时使⽤ @Data 和 @Builder 的坑,你中招没?
再聊聊我常用的15个数据源网站
. Bytecode structure of class file
Service asynchronous communication
Matlab learning notes
Meet the level 3 requirements of ISO 2.0 with the level B construction standard of computer room | hybrid cloud infrastructure
用tkinter做一个简单图形界面
Advanced learning of MySQL -- basics -- multi table query -- self join
A brief history of deep learning (I)
Dr selection of OSPF configuration for Huawei devices
学习光线跟踪一样的自3D表征Ego3RT
Dell Notebook Periodic Flash Screen Fault
[daily problem insight] prefix and -- count the number of fertile pyramids in the farm
英雄联盟|王者|穿越火线 bgm AI配乐大赛分享
深入探索编译插桩技术(四、ASM 探秘)
【软件逆向-自动化】逆向工具大全