设置文件夹的标记属性
at 2024.10.24 ca Window系统设置与应用 by admin
文件夹添加标记属性:
右键--排序方式--更多--标记
文件夹添加标记:
<# : Tag_Folder.bat v1.1 @ECHO OFF SETLOCAL FOR /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') DO ( ATTRIB -h -s desktop.ini >NUL TYPE desktop.ini|FINDSTR /V "F29F85E0 Prop5" > "%temp%\desktop.ini" ECHO [{F29F85E0-4FF9-1068-AB91-08002B27B3D9}] >> "%temp%\desktop.ini" ECHO Prop5=31,%%~I >> "%temp%\desktop.ini" ( echo set shell = CreateObject^("Shell.Application"^) echo set folder = shell.NameSpace^("%cd%"^) echo folder.MoveHere "%temp%\desktop.ini", 4+16+1024 )>"%temp%\updateTag.vbs" cscript //nologo //b "%temp%\updateTag.vbs" ATTRIB +h +s desktop.ini ) EXIT : end Batch portion / begin PowerShell hybrid chimera #> Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing $form = New-object Windows.Forms.Form $label = New-Object Windows.Forms.Label $textbox = New-Object Windows.Forms.TextBox $button = New-Object Windows.Forms.Button $form.StartPosition = 'CenterScreen' $form.Size = New-Object Drawing.Size(240,150) $form.Text = "Tag 设置" $form.FormBorderStyle = "FixedDialog" $form.MaximizeBox = $false $form.MinimizeBox = $false $form.AcceptButton = $button $label.Location = New-Object Drawing.Point(20,20) $label.Size = New-Object Drawing.Size(180,23) $label.Text = "输入想要的标记" $textbox.Location = New-Object Drawing.Point(20,43) $textbox.Size = New-Object Drawing.Size(180,23) $button.Location = New-Object Drawing.Point(160,76) $button.Size = New-Object Drawing.Size(50,23) $button.Text = "确认" $button.DialogResult = "OK" $button.Add_Click({$form.Close()}) $form.Controls.Add($label) $form.Controls.Add($textbox) $form.Controls.Add($button) $form.ShowDialog() Write-Output ""$textbox.Text""
复制代码保存为.bat文件放入需要添加标记的文件夹内,运行添加标记
添加右键菜单:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\background\shell\设置文件夹标记] "icon"="\"C:\\TagTag.ico\"" [HKEY_CLASSES_ROOT\Directory\background\shell\设置文件夹标记\command] @="cmd /c \"start /min C:\\TagTag.bat\"" ; cmd /c: 执行命令并关闭命令窗口 ; start /min: 以最小化状态启动批处理文件
版权声明
本站所有资源均来自网络,本站只做收集汇总工作!