|
lujice
新手上路

积分 12
发帖 13
注册 2010-3-3
状态 离线
|
『楼 主』:
挑战——批量修改后缀名、并同时颠倒文件名
使用 LLM 解释/回答一下
挑战——批量修改后缀名、并同时颠倒文件名
批处理的用途是——
1、把目标文件夹(包含它的所有子目录)里,某类指定后缀名的文件,批量的修改为其它指定的后缀名。
2、同时,把目标文件夹(包含它的所有子目录)里,某类指定后缀名的文件,批量的颠倒文件名。
补充说明——
1、批处理必须要支持:由用户在批处理的运行窗口,自行输入目标文件夹(或拖放获取路径)、原后缀名和新后缀名。
2、目标文件夹的路径,有可能含有空格。
比如“C:\Documents and Settings\Administrator”目录。
3、目标文件夹的路径,有可能含有汉字。
比如“C:\Documents and Settings\Administrator\桌面”目录。
4、目标文件夹的路径,有可能含有特殊字符。
比如"^"和“&”字符。
5、具体改名的例子是:
比如"1234.原后缀名",改名后就变为“4321.新后缀名”
6、双后缀名的情况是:
比如"1234.jpg.原后缀名",改名后就变为“gpj.4321.新后缀名”。
总之,只认最后一个后缀名为真实后缀名。前面的,全部按文件名处理,整体颠倒!
7、批处理必须要支持,对系统或隐藏属性文件的改名。但是,改名后,又必须恢复原来的属性。
Last edited by lujice on 2011-1-22 at 20:16 ]
Challenge - Batch Modify File Extensions and Reverse File Names Simultaneously
The purposes of the batch processing are:
1. Batch modify the file extensions of specified types of files in the target folder (including all its subdirectories) to other specified extensions.
2. At the same time, batch reverse the file names of specified types of files in the target folder (including all its subdirectories).
Supplementary Notes -
1. The batch processing must support: the user can enter the target folder (or drag and drop to get the path) directly in the running window of the batch processing, as well as the original extension and the new extension.
2. The path of the target folder may contain spaces.
For example, the directory "C:\Documents and Settings\Administrator".
3. The path of the target folder may contain Chinese characters.
For example, the directory "C:\Documents and Settings\Administrator\Desktop".
4. The path of the target folder may contain special characters.
For example, characters "^" and "&".
5. Specific examples of renaming are:
For example, "1234.original_extension" is renamed to "4321.new_extension".
6. In the case of double extensions:
For example, "1234.jpg.original_extension" is renamed to "gpj.4321.new_extension". In short, only recognize the last extension as the real extension. All the previous ones are treated as the file name as a whole and reversed!
7. The batch processing must support renaming system or hidden attribute files. However, after renaming, the original attributes must be restored.
Last edited by lujice on 2011-1-22 at 20:16 ]
|
|
2011-1-22 18:32 |
|
|
lujice
新手上路

积分 12
发帖 13
注册 2010-3-3
状态 离线
|
『第 2 楼』:
一个失败的例子
使用 LLM 解释/回答一下
以下代码,支持子目录、支持路径含特殊字符、支持文件名含特殊字符。不支持颠倒文件名、不支持路径含空格、不支持文件名含空格。
@echo off
:0
cls
echo.
echo. ╭────────╮
echo. ╭─────┤ 使 用 说 明 ├────╮
echo. │ ╰────────╯ │
echo. │ │
echo. │ 1、本工具的用途是——把指定目录 │
echo. │ 里,某类指定后缀名的文件,批 │
echo. │ 量的修改为其它指定的后缀名。 │
echo. │ │
echo. │ 2、每一步输入完毕,都请敲回车! │
echo. │ │
echo. │ 3、注意——只输入后缀名,不要 │
echo. │ 输入后缀名前的“.” │
echo. │ │
echo. │ 4、文件夹的路径中如有空格和特殊 │
echo. │ 字符,请手打输入,不要拖放! │
echo. │ │
echo. ╰───────────────────╯
echo.&echo 请输入文件夹的路径,或拖放文件夹到本窗口
set LJ=
set /p LJ=
if /i "%LJ%"=="" goto 0
echo.&echo 请输入修改前的后缀名:
set q=
set /p q=
if /i "%q%"=="" goto 0
echo.&echo 请输入修改后的后缀名:
set h=
set /p h=
if /i "%h%"=="" goto 0
for /r %LJ% %%i in (*.%q%) do ren %%i *.%h%
echo.&echo. 后缀名已批量修改成功!
echo.&echo. 请打开文件夹看看吧!
start %LJ%
pause
goto 0
Last edited by lujice on 2011-1-22 at 18:45 ]
The following code supports subdirectories, supports paths with special characters, and supports file names with special characters. Does not support reversing file names, does not support paths with spaces, and does not support file names with spaces.
@echo off
:0
cls
echo.
echo. ╭────────╮
echo. ╭─────┤ I N S T R U C T I O N S ├────╮
echo. │ ╰────────╯ │
echo. │ │
echo. │ 1、The purpose of this tool is - batch modify files with specified suffixes in the specified directory to other specified suffixes. │
echo. │ │
echo. │ 2、Please press Enter after each input! │
echo. │ │
echo. │ 3、Note - only enter the suffix, do not enter the "." before the suffix │
echo. │ │
echo. │ 4、If there are spaces and special characters in the folder path, please type it in manually, do not drag and drop! │
echo. │ │
echo. ╰───────────────────╯
echo.&echo Please enter the path of the folder, or drag and drop the folder into this window
set LJ=
set /p LJ=
if /i "%LJ%"=="" goto 0
echo.&echo Please enter the original suffix:
set q=
set /p q=
if /i "%q%"=="" goto 0
echo.&echo Please enter the new suffix:
set h=
set /p h=
if /i "%h%"=="" goto 0
for /r %LJ% %%i in (*.%q%) do ren %%i *.%h%
echo.&echo. Suffixes have been batch modified successfully!
echo.&echo. Please open the folder and take a look!
start %LJ%
pause
goto 0
Last edited by lujice on 2011-1-22 at 18:45 ]
|
|
2011-1-22 18:35 |
|
|
lujice
新手上路

积分 12
发帖 13
注册 2010-3-3
状态 离线
|
『第 3 楼』:
好奇怪?怎么又支持空格、特殊字符了?
使用 LLM 解释/回答一下
好奇怪?怎么又支持空格、特殊字符了?
以下例子,语法与上大体相同。但是,它就是要支持空格和特殊字符!
百思不得其解......
@echo off
:hsz
cls
echo.&echo.&echo 请拖放要建立回收站的目录到本窗口!
echo.
set /p mulu=
echo.&echo 请手打输入、或者粘贴输入回收站的名字。
echo.&echo 粘贴的方法是——在批处理的运行窗口点右键。
echo.&echo 如果回收站的名字中,包含空格、特殊字符和汉字,
echo.&echo 则需要在名字的前后加上:英文的双引号—— "
echo.
set /p minzi=
md %mulu%\%minzi%
attrib +s +h %mulu%\%minzi%
(echo
echo CLSID={645FF040-5081-101B-9F08-00AA002F954E})>%mulu%\%minzi%\desktop.ini
attrib +s +h %mulu%\%minzi%\desktop.ini
echo.&echo 回收站已建立成功!
echo.&echo 打开看看吧!
echo.
pause
start "" %mulu%
goto (上级菜单的标签号)
Last edited by lujice on 2011-1-22 at 19:30 ]
It's so strange? Why does it support spaces and special characters again?
The following example has roughly the same syntax. But it just wants to support spaces and special characters!
I can't figure it out......
@echo off
:hsz
cls
echo.&echo.&echo Please drag and drop the directory where you want to create the recycle bin to this window!
echo.
set /p mulu=
echo.&echo Please type in or paste the name of the recycle bin.
echo.&echo The way to paste is - right-click in the running window of the batch processing.
echo.&echo If the name of the recycle bin contains spaces, special characters and Chinese characters,
echo.&echo Then you need to add: English double quotes - " before and after the name
echo.
set /p minzi=
md %mulu%\%minzi%
attrib +s +h %mulu%\%minzi%
(echo
echo CLSID={645FF040-5081-101B-9F08-00AA002F954E})>%mulu%\%minzi%\desktop.ini
attrib +s +h %mulu%\%minzi%\desktop.ini
echo.&echo The recycle bin has been successfully created!
echo.&echo Open it and have a look!
echo.
pause
start "" %mulu%
goto (label number of the upper menu)
Last edited by lujice on 2011-1-22 at 19:30 ]
|
|
2011-1-22 19:05 |
|
|
fsfss
初级用户
 
积分 22
发帖 20
注册 2009-7-6
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
指定后缀名的文件,批量的颠倒文件名
@echo off
if "%1" equ "" echo.须要参数,例如:%~0 *.txt&exit/b
SET "LOG=\ReDo.BAT"
for %%i in (%*) do (
cd/d "%%~di"
echo.处理:"%%~nxi"
call:reverse "%%~nxi"
)
goto:end
:reverse
echo.CD/D "%~dp1">>"%LOG%"
set "fname=%~1"
set "temp_name=%~1"
set new_name=
:LOOP
set temp_name=%temp_name:~0,-1%
if "%temp_name%" equ "" goto:out
set new_name=%new_name%%temp_name:~-1%
goto:LOOP
:out
echo.REN "%new_name%" "%fname%">>"%LOG%"
ren "%fname%" "%new_name%"
goto:eof
:end
echo.撤消,请运行: "%LOG%" to cancel
pause
Batch-rename files with specified extension by reversing their filenames
@echo off
if "%1" equ "" echo.Required parameter, e.g.: %~0 *.txt&exit/b
SET "LOG=\ReDo.BAT"
for %%i in (%*) do (
cd/d "%%~di"
echo.Processing: "%%~nxi"
call:reverse "%%~nxi"
)
goto:end
:reverse
echo.CD/D "%~dp1">>"%LOG%"
set "fname=%~1"
set "temp_name=%~1"
set new_name=
:LOOP
set temp_name=%temp_name:~0,-1%
if "%temp_name%" equ "" goto:out
set new_name=%new_name%%temp_name:~-1%
goto:LOOP
:out
echo.REN "%new_name%" "%fname%">>"%LOG%"
ren "%fname%" "%new_name%"
goto:eof
:end
echo.Undo, please run: "%LOG%" to cancel
pause
|
|
2011-1-22 21:44 |
|
|
lujice
新手上路

积分 12
发帖 13
注册 2010-3-3
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
以下,是“批处理之家论坛”“tmplinshi ”老大的代码——
@echo off
:Input_Folder
echo 请输入文件夹路径(或拖放文件夹到本窗口):
set Folder=
set /p Folder=
if not defined Folder goto Input_Folder
if not exist "%Folder:"=%" (
echo * 错误:不存在该文件夹
goto Input_Folder
)
:Input_OldExt
set OldExt=
set /p OldExt=请输入原后缀名:
if not defined OldExt goto Input_OldExt
:Input_NewExt
set NewExt=
set /p NewExt=请输入新后缀名:
if not defined NewExt goto Input_NewExt
rem 去除路径中的引号、后缀中的“.”及前面的字符
set "Folder=%Folder:"=%"
set "OldExt=%OldExt:*.=%"
set "NewExt=%NewExt:*.=%"
for /f "delims=" %%i in ('dir /a:-d /b /s "%Folder%\*.%OldExt%"') do (
set fPath=%%~dpi
set fName=%%~ni
set fAttr=%%~ai
SetLocal EnableDelayedExpansion
rem 判断有没有“系统”和“隐藏”属性
set AttrList=
if "!fAttr:s=!" neq "!fAttr!" set AttrList= s
if "!fAttr:h=!" neq "!fAttr!" set AttrList=!AttrList! h
if defined AttrList (
attrib !AttrList: = -! "!fPath!!fName!.!OldExt!"
)
rem 计算文件名的字符个数
set /a n = 8189, b = 0
for /l %%a in (1 1 13) do (
set /a "a = (n - b) / 2 + b"
for %%b in (!a!) do (
if "!fName:~%%b,1!"=="" (set n=!a!) else set b=!a!
)
)
rem 颠倒文件名
set /a n -= 1
for /l %%n in (0 1 !n!) do (
set NewName=!fName:~%%n,1!!NewName!
)
rem 重命名
ren "!fPath!!fName!.!OldExt!" "!NewName!.!NewExt!"
rem 如果之前修改了文件属性,则改回去
if defined AttrList (
attrib !AttrList: = +! "!fPath!!NewName!.!NewExt!"
)
EndLocal
)
试验了!目前还没有发现Bug!!
这个工具,用于禁止(恢复)计算机某些功能的执行。比如禁止(恢复)“我的电脑——右键——管理”、比如禁止(恢复)“文件夹选项”、比如禁止(恢复)控制面板的所有项目、比如禁止(恢复)组策略、比如禁止(恢复)注册表......
呵呵!这种禁止方法,别人还能轻易破解吗???
万分感谢tmplinshi 老大!!
马上回去,抱起论坛的教程,慢慢咀嚼tmplinshi 老大的代码......
再次感谢tmplinshi 老大!!
Last edited by lujice on 2011-1-23 at 11:05 ]
The following is the code from Boss "tmplinshi" of the "Batch Processing Home Forum" —
@echo off
:Input_Folder
echo Please enter the folder path (or drag and drop the folder to this window):
set Folder=
set /p Folder=
if not defined Folder goto Input_Folder
if not exist "%Folder:"=%" (
echo * Error: The folder does not exist
goto Input_Folder
)
:Input_OldExt
set OldExt=
set /p OldExt=Please enter the original suffix name:
if not defined OldExt goto Input_OldExt
:Input_NewExt
set NewExt=
set /p NewExt=Please enter the new suffix name:
if not defined NewExt goto Input_NewExt
rem Remove quotes from the path, and the "." and characters before it from the suffix
set "Folder=%Folder:"=%"
set "OldExt=%OldExt:*.=%"
set "NewExt=%NewExt:*.=%"
for /f "delims=" %%i in ('dir /a:-d /b /s "%Folder%\*.%OldExt%"') do (
set fPath=%%~dpi
set fName=%%~ni
set fAttr=%%~ai
SetLocal EnableDelayedExpansion
rem Determine if there are "system" and "hidden" attributes
set AttrList=
if "!fAttr:s=!" neq "!fAttr!" set AttrList= s
if "!fAttr:h=!" neq "!fAttr!" set AttrList=!AttrList! h
if defined AttrList (
attrib !AttrList: = -! "!fPath!!fName!.!OldExt!"
)
rem Calculate the number of characters in the file name
set /a n = 8189, b = 0
for /l %%a in (1 1 13) do (
set /a "a = (n - b) / 2 + b"
for %%b in (!a!) do (
if "!fName:~%%b,1!"=="" (set n=!a!) else set b=!a!
)
)
rem Reverse the file name
set /a n -= 1
for /l %%n in (0 1 !n!) do (
set NewName=!fName:~%%n,1!!NewName!
)
rem Rename
ren "!fPath!!fName!.!OldExt!" "!NewName!.!NewExt!"
rem If the file attributes were modified before, change them back
if defined AttrList (
attrib !AttrList: = +! "!fPath!!NewName!.!NewExt!"
)
EndLocal
)
Tested! No bugs found so far!
This tool is used to prohibit (restore) the execution of certain functions of the computer. For example, prohibit (restore) "My Computer - Right - Click - Manage", for example, prohibit (restore) "Folder Options", for example, prohibit (restore) all items in the Control Panel, prohibit (restore) Group Policy, prohibit (restore) Registry......
Hehe! Can others easily crack this prohibition method???
Thank you very much, Boss tmplinshi!
Go back immediately, pick up the forum's tutorial, and slowly savor Boss tmplinshi's code......
Thank you again, Boss tmplinshi!
Last edited by lujice on 2011-1-23 at 11:05 ]
|
|
2011-1-23 11:03 |
|
|
lujice
新手上路

积分 12
发帖 13
注册 2010-3-3
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
虽然我是一个不折不扣的菜鸟,只会最简单的命令。但是,我敢于尝试......
过两天,我会发一个U盘病毒免疫批处理。有一点原创的DIY,就是加一个把隐私文件藏进去的功能,再加强下防删除、防更名的能力。
高手就不看了,全是用简单命令写的语句。
回去抠脑壳吧
Although I am a complete novice, only knowing the simplest commands. But, I dare to try...
In a couple of days, I will post a USB flash drive virus immunity batch processing. There is a bit of original DIY, which is to add a function to hide private files, and strengthen the ability to prevent deletion and renaming.
Experts won't look at it, all are written with simple commands.
Go back and scratch your head
|
|
2011-1-23 11:14 |
|
|
modestleaner
初级用户
  beginner
积分 26
发帖 27
注册 2011-1-13
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
关于楼主和那个LZ贴的代码小菜有点不是很懂,望解答
在设置文件路径那段
set lj=
set /p lj=
是可以把使用这个批处理的人拖进来或者输入的路径赋给LJ
但是后面在输入文件的后缀名的时候还是用了
set q=
或者类似的东西,请问难道可以把后缀也拖进去么?
Regarding the code in the original poster's and that LZ's post, I don't quite understand it. Could you please explain?
In the part where setting the file path is done:
set lj=
set /p lj=
This can assign the path dragged in or input by the person using this batch script to LJ. But later when entering the file extension, it still uses
set q=
or something similar. Then, does it mean that the extension can also be dragged in?
|

路漫漫其修远兮~ |
|
2011-1-23 20:36 |
|
|
glodboy
新手上路

积分 10
发帖 11
注册 2010-12-24
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by modestleaner at 2011-1-23 20:36:
关于楼主和那个LZ贴的代码小菜有点不是很懂,望解答
在设置文件路径那段
set lj=
set /p lj=
是可以把使用这个批处理的人拖进来或者输入的路径赋给 ...
set lj=
rem 设置变量名称
set /p lj=
rem 把获取的值赋给lj
个人理解,错误的地方请指正。
Originally posted by modestleaner at 2011-1-23 20:36:
I don't quite understand the little code snippet posted by the LZ and the original poster. I hope for an explanation.
In the part where the file path is set:
set lj=
set /p lj=
It can assign the path dragged in or entered by the person using this batch file to...
set lj=
rem Set variable name
set /p lj=
rem Assign the obtained value to lj
Personal understanding, please correct any errors.
|
|
2011-1-24 12:09 |
|
|
lujice
新手上路

积分 12
发帖 13
注册 2010-3-3
状态 离线
|
『第 9 楼』:
菜鸟对代码的说明
使用 LLM 解释/回答一下
Originally posted by modestleaner at 2011-1-23 20:36:
关于楼主和那个LZ贴的代码小菜有点不是很懂,望解答
在设置文件路径那段
set lj=
set /p lj=
是可以把使用这个批处理的人拖进来或者输入的路径赋给 ...
首先申明,我也是个很菜很菜的菜鸟,就连for语句都不怎么懂。共同学习吧!
@echo off(不显示执行命令)
:hsz(本段标签号)
echo.&echo.&echo 请拖放要建立回收站的目录到本窗口!
echo.
set /p mulu=(给变量%mulu%赋值,支持手打输入或拖放)
echo.&echo 请手打输入、或者粘贴输入回收站的名字。
echo.&echo 粘贴的方法是——在批处理的运行窗口点右键。
echo.&echo 如果回收站的名字中,包含空格、特殊字符和汉字,
echo.&echo 则需要在名字的前后加上:英文的双引号—— "
echo.
set /p minzi==(手打输入给变量%minzi%赋值)
md %mulu%\%minzi%(在指定目录下建立指定名字的文件夹)
attrib +s +h %mulu%\%minzi%(更改它的属性为系统、隐藏)
(echo
echo CLSID={645FF040-5081-101B-9F08-00AA002F954E})>%mulu%\%minzi%\desktop.ini(把括号内的字符写入目标文件夹下的“desktop.ini”文件)
attrib +s +h %mulu%\%minzi%\desktop.ini(更改“desktop.ini”文件的属性为系统、隐藏)
echo.&echo 回收站已建立成功!
echo.&echo 打开看看吧!
echo.
pause(暂停)
start "" %mulu%(打开建立回收站的目录)
goto (上级菜单的标签号)
Last edited by lujice on 2011-1-24 at 15:47 ]
Originally posted by modestleaner at 2011-1-23 20:36:
I don't quite understand the code snippet posted by the original poster and that LZ. Hope for an explanation.
In the part where the file path is set:
set lj=
set /p lj= can assign the path dragged in or entered by the person using this batch script to...
First of all, I declare that I am also a very, very rookie, and I don't even understand the for statement very well. Let's learn together!
@echo off (do not display executed commands)
:hsz (this section's label number)
echo.&echo.&echo Please drag and drop the directory for which you want to create the recycle bin into this window!
echo.
set /p mulu= (assign a value to variable %mulu%, supports hand input or drag and drop)
echo.&echo Please hand-enter or paste the name of the recycle bin.
echo.&echo The way to paste is - right-click in the running window of the batch script.
echo.&echo If the name of the recycle bin contains spaces, special characters, and Chinese characters,
echo.&echo then you need to add: English double quotes before and after the name - "
echo.
set /p minzi== (hand-enter to assign a value to variable %minzi%)
md %mulu%\%minzi% (create a folder with the specified name in the specified directory)
attrib +s +h %mulu%\%minzi% (change its attributes to system and hidden)
(echo
echo CLSID={645FF040-5081-101B-9F08-00AA002F954E})>%mulu%\%minzi%\desktop.ini (write the characters in the parentheses to the "desktop.ini" file under the target folder)
attrib +s +h %mulu%\%minzi%\desktop.ini (change the attribute of the "desktop.ini" file to system and hidden)
echo.&echo The recycle bin has been successfully created!
echo.&echo Open it and take a look!
echo.
pause (pause)
start "" %mulu% (open the directory where the recycle bin is created)
goto (label number of the upper menu)
Last edited by lujice on 2011-1-24 at 15:47 ]
|
|
2011-1-24 15:43 |
|
|
modestleaner
初级用户
  beginner
积分 26
发帖 27
注册 2011-1-13
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by glodboy at 2011-1-24 12:09:
set lj=
rem 设置变量名称
set /p lj=
rem 把获取的值赋给lj
个人理解,错误的地方请指正。
首先感谢楼上各位的解答,不过恐怕兄台这里理解错了<img src="images/smilies/face-raspberry.png" align="absmiddle" border="0">
/p 的作用是允许变量数值设成用户的一行输入。
那个在制定文件夹下建立回收站的倒是看懂了,没懂的还是那句。
Originally posted by glodboy at 2011-1-24 12:09:
set lj=
rem Set variable name
set /p lj=
rem Assign the obtained value to lj
Personal understanding, please correct any mistakes.
First of all, thank you to the above-mentioned friends for their answers, but I'm afraid the brother here has an incorrect understanding :P
The function of /p is to allow the variable value to be set as a line of input from the user.
I understand the part about creating a recycle bin in the specified folder, but I still don't understand that sentence.
|

路漫漫其修远兮~ |
|
2011-1-24 18:06 |
|
|
lujice
新手上路

积分 12
发帖 13
注册 2010-3-3
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Originally posted by modestleaner at 2011-1-23 20:36:
关于楼主和那个LZ贴的代码小菜有点不是很懂,望解答
在设置文件路径那段
set lj=
set /p lj=
是可以把使用这个批处理的人拖进来或者输入的路径赋给 ...
后缀不能拖进去。把文件拖进去后,显示的是包含文件名的完整路径。除非,你再用退格键,删除多余的字符只留下后缀名。但是这样做,和手打输入后缀名有何区别?
Last edited by lujice on 2011-1-24 at 19:49 ]
Originally posted by modestleaner at 2011-1-23 20:36:
There is a bit of confusion regarding the original poster and the code snippet the LZ posted. Hope to get an explanation.
In the part where the file path is set:
set lj=
set /p lj=
This can assign the path dragged in by the person using this batch script or entered by them to...
The file extension cannot be dragged in. After dragging a file in, the full path including the file name is displayed. Unless you use the backspace key to delete the extra characters and only leave the file extension. But what's the difference between this and typing in the file extension manually?
Last edited by lujice on 2011-1-24 at 19:49 ]
|
|
2011-1-24 19:47 |
|
|
lujice
新手上路

积分 12
发帖 13
注册 2010-3-3
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
Originally posted by modestleaner at 2011-1-23 20:36:
关于楼主和那个LZ贴的代码小菜有点不是很懂,望解答
在设置文件路径那段
set lj=
set /p lj=
是可以把使用这个批处理的人拖进来或者输入的路径赋给 ...
后缀不能拖进去。把文件拖进去后,显示的是包含文件名的完整路径。除非,你再用退格键,删除多余的字符只留下后缀名。但是这样做,和手打输入后缀名有何区别?
Originally posted by modestleaner at 2011-1-23 20:36:
I don't quite understand the code snippet posted by the original poster and that LZ. Hope for an explanation.
In the part where the file path is set:
set lj=
set /p lj=
This can assign the path dragged in or entered by the person using this batch file to...
The file extension cannot be dragged in. After dragging a file in, the full path including the file name is displayed. Unless you use the backspace key to delete the excess characters and only leave the file extension. But what's the difference between doing this and typing in the file extension manually?
|
|
2011-1-24 19:48 |
|
|
modestleaner
初级用户
  beginner
积分 26
发帖 27
注册 2011-1-13
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
Originally posted by lujice at 2011-1-24 19:48:
后缀不能拖进去。把文件拖进去后,显示的是包含文件名的完整路径。除非,你再用退格键,删除多余的字符只留下后缀名。但是这样做,和手打输入后缀名有何区别?
嗯,我知道问价后缀名不能拖进去。我的意思是那么那句话不是多余的么?
既然后缀不能拖进去,只有靠手输入的话。
Originally posted by lujice at 2011-1-24 19:48:
The file extension cannot be dragged in. After dragging the file in, the full path including the file name is displayed. Unless you use the backspace key to delete the extra characters and only leave the file extension. But what's the difference between doing this and typing the file extension manually?
Hmm, I know that the file extension can't be dragged in. What I mean is that then is that sentence redundant?
Since the extension can't be dragged in and can only be entered manually.
|

路漫漫其修远兮~ |
|
2011-1-25 00:48 |
|