|
|
发表于 2023-5-6 10:58:33
|
显示全部楼层
- rem 另存为 ANSI 编码
- ' & cls & cscript.exe /nologo /e:vbscript "%~f0" %* & pause & exit
- Dim oWshShell, oFSO, s, oShell
- Const file = "1.jpg" '原文件。支持文件拖放,支持文件名作为命令行参数
- Set oShell = CreateObject("Shell.Application")
- Set oWshShell = CreateObject("WScript.Shell")
- Set oFSO = CreateObject("Scripting.FileSystemObject")
- s = oFSO.GetParentFolderName(WScript.ScriptFullname)
- oWshShell.CurrentDirectory = s
- If WScript.Arguments.Count > 0 Then
- For Each s In WScript.Arguments
- Call run(s)
- Next
- Else
- Call run(file)
- End If
- Sub run(ByVal file)
- Dim s, oFolder, oFolderItem, i
- s = oFSO.GetAbsolutePathName(file)
- WScript.Echo s
- Set oFolder = oShell.NameSpace(oFSO.GetParentFolderName(s))
- Set oFolderItem = oFolder.ParseName(oFSO.GetFileName(s))
- For i = 0 To 500
- If oFolder.GetDetailsOf(Null, i) = "标记" Then s = i
- Next
- s = oFolder.GetDetailsOf(oFolderItem, s)
- If InStr(s, ";") Then
- For Each i In Split(s, ";")
- WScript.Echo "标记" & vbTab & Trim(i)
- Next
- Else
- WScript.Echo "标记" & vbTab & s
- End If
- End Sub
复制代码 读取标记 |
|