当前位置:网站首页>[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 .
边栏推荐
- stm32F407-------SPI通信
- [yolov5 6.0 | 6.1 deploy tensorrt to torch serve] environment construction | model transformation | engine model deployment (detailed packet file writing method)
- 【软件逆向-求解flag】内存获取、逆变换操作、线性变换、约束求解
- Link sharing of STM32 development materials
- 再聊聊我常用的15个数据源网站
- Configuring OSPF basic functions for Huawei devices
- dynamic programming
- Deeply explore the compilation and pile insertion technology (IV. ASM exploration)
- Set (generic & list & Set & custom sort)
- 腾讯云 WebShell 体验
猜你喜欢
深度学习之数据处理
Learn to use code to generate beautiful interface documents!!!
Stm32f407 ------- SPI communication
【批处理DOS-CMD命令-汇总和小结】-字符串搜索、查找、筛选命令(find、findstr),Find和findstr的区别和辨析
Return to blowing marshland -- travel notes of zhailidong, founder of duanzhitang
用tkinter做一个简单图形界面
Article management system based on SSM framework
[user defined type] structure, union, enumeration
批量获取中国所有行政区域经边界纬度坐标(到县区级别)
第七篇,STM32串口通信编程
随机推荐
Advanced learning of MySQL -- Fundamentals -- concurrency of transactions
Advantages and disadvantages of code cloning
Common shortcuts to idea
英雄联盟|王者|穿越火线 bgm AI配乐大赛分享
深度学习简史(二)
【批处理DOS-CMD命令-汇总和小结】-跳转、循环、条件命令(goto、errorlevel、if、for[读取、切分、提取字符串]、)cmd命令错误汇总,cmd错误
学习使用代码生成美观的接口文档!!!
Mujoco second order simple pendulum modeling and control
学习光线跟踪一样的自3D表征Ego3RT
[user defined type] structure, union, enumeration
Model-Free Prediction
【JokerのZYNQ7020】AXI_EMC。
Use mujoco to simulate Cassie robot
Provincial and urban level three coordinate boundary data CSV to JSON
stm32F407-------DAC数模转换
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
stm32F407-------SPI通信
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
【JokerのZYNQ7020】AXI_ EMC。
Mongodb client operation (mongorepository)