本帖最后由 老球球 于 2016-5-1 08:33 编辑
这就是你要的按钮
更新一下,上一个碰到没有扩展名的会出错
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>添加日期</label>
<tip>添加当前日期到文件名</tip>
<icon1>#rename2</icon1>
<function type="normal">
<instruction>Rename PATTERN * TO * </instruction>
<instruction>@nodeselect</instruction>
<instruction />
<instruction>@script vbscript</instruction>
<instruction>Option Explicit</instruction>
<instruction />
<instruction>Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)</instruction>
<instruction> Dim DotPos, strFileExt</instruction>
<instruction> DotPos = InStrRev(strFileName, ".")</instruction>
<instruction> If DotPos <> 0 Then </instruction>
<instruction> strFileExt = Right(strFileName, Len(strFileName) - DotPos + 1)</instruction>
<instruction> strNewName = left(strFileName, DotPos - 1) & " " & Replace(Date(), "/", "-") & strFileExt</instruction>
<instruction> Else</instruction>
<instruction> strFileExt = ""</instruction>
<instruction> strNewName = strFileName & " " & Replace(Date(), "/", "-") & strFileExt</instruction>
<instruction> End If</instruction>
<instruction> DOpus.OutPut(strNewName)</instruction>
<instruction>End Function</instruction>
</function>
</button>
|