Board logo

标题: 分享:Unname - 重命名文件使其只留下后缀名 [打印本页]

作者: tireless     时间: 2008-4-11 16:11    标题: 分享:Unname - 重命名文件使其只留下后缀名
来自著名的Replacer的软件作者的作品

效果:



和alt + 0160 (小键盘) 是不同的:


Unname.cmd
:: Unname 0.1 by undefined
:: www3.telus.net/_/unname

@echo off
title Unname
ver|find "NT">nul&&(
echo.Windows XP/2000 only.
pause>nul&goto:eof)

if not '%1'=='' (
echo."%*"|find "?">nul&&(
echo.Removes filenames.
echo.&echo.Usage:
echo. %~n0 "File"
echo.&echo.Example:
echo. %~n0 "C:\File.lnk"
goto:eof)
set "fil=%1"
shift&goto:prm
if not '%1'=='' (
echo.One file at a time.
pause>nul&goto:eof))

:fil
cls&set "fil="
echo.Drag and drop^
a file into this window^
to remove its name.
echo.&set/pfil= 
:prm
if not defined fil goto:fil
echo.&call set "quo=%fil%"
set "quo=###%quo%###"
set "quo=%quo:"###=%"
set "quo=%quo:###"=%"
set "quo=%quo:###=%"
set fil="%quo%"&set quo=
if not exist %fil% (
echo.File does not exist.
pause>nul&goto:fil)
for %%* in (%fil%) do (
echo.%%~a*|find "d">nul&&(
echo.Folders not allowed.
pause>nul&goto:fil)
if "%%~x*"=="" (
echo.Extension required.
pause>nul&goto:fil)
if exist "%%~dpx*" (
echo.Unnamed file already^
exists in the same folder.
pause>nul&goto:fil)
ren %%* "%%~x*"||(
echo.Failed.
pause>nul&goto:eof))
echo.Complete.
pause>nul


主页 Unname介绍 官方下载

作者: knoppix7     时间: 2008-4-11 18:09
set "quo=###%quo%###"
set "quo=%quo:"###=%"
set "quo=%quo:###"=%"
set "quo=%quo:###=%"


...................去掉个引号就那么...

作者: plp626     时间: 2008-4-13 16:56
没那么麻烦:
echo\>.pp365

作者: zh159     时间: 2008-4-13 17:27
LZ发的好长

Originally posted by plp626 at 2008-4-13 16:56:
没那么麻烦:
echo\>.pp365

我习惯用
echo.>...

作者: plp626     时间: 2008-4-13 18:12
Originally posted by zh159 at 2008-4-13 05:27 PM:
LZ发的好长


我习惯用
echo.>...


你这个命令提示符会提示拒绝访问,我机子是xp5.1