文件: root - text - computing - mvjpg.bat.txt
标签: 程序, Programming, | 英文 | 主页 | 类别: 计算机科学 | 3812 次阅读, 39724 次搜索 | 280 个单词
| 浏览 | 博客存档
![定阅此目录的博客 定阅此目录的博客](/images/form/rss.gif)
标签: 程序, Programming, | 英文 | 主页 | 类别: 计算机科学 | 3812 次阅读, 39724 次搜索 | 280 个单词
![定阅此目录的博客 定阅此目录的博客](/images/form/rss.gif)
I have come to a problem... i have a pictures folder which has lots of subdirs and
lots of irregular filenames such as "kdjfksjdf.jpg", "kdjflkajsdfasd.jpg"
usually i renamed them randomly to avoid the same filenames when i grabbed it from internet...
So i want to upload them to the website and i want them arranged in good order....
Each folder should be ordered by numbers 1, 2, 3.....
Each folder has at most 39 files, 1.jpg, 2.jpg, .... 39.jpg
How can I do this?
So .... Super XP has provided batch file....
I 've done a little programming, it is fun!
******* save the following as .BAT file and modify vars as needed **********
@echo off
set cc=0
set dd=1
set od=D:\1
set td=D:\2
set nn=39
set ex=jpg
cls
echo.
echo Windows XP Batch file
echo Created by Zhihua Lai, 2007-Aug-30
echo The program can move all the %ex% files in %od% folder into
echo %td% folder and rename it by number
echo each folder (also labeled as number %dd% var) contains at most
echo %nn% pictures....
echo.
echo Press any key to continue, press Ctrl-C to exit....
pause >nul
rem cls
if not exist %td% mkdir %td% && echo %td% created...
for /f "usebackq delims==" %%i in (`dir /s /b %od%\*.%ex%`) do (
call :dothing "%%i"
)
goto :clear
:dothing
if exist "%1\nul" goto :end
if not exist "%td%\%dd%" mkdir "%td%\%dd%" && echo "%td%\%dd%" created...
set /a cc=cc+1 >nul
move %1 "%td%\%dd%\%cc%.jpg"
echo %1 has been moved to "%td%\%dd%\%cc%.jpg"!!!!
if /i "%cc%" EQU "%nn%" set /a cc=0 && set /a dd=dd+1
goto :end
:clear
set cc=
set dd=
set od=
set td=
set nn=
set ex=
:end
标签: 程序, Programming, | 英文 | 主页 | 类别: 计算机科学 | 3812 次阅读, 39724 次搜索 | 280 个单词 lots of irregular filenames such as "kdjfksjdf.jpg", "kdjflkajsdfasd.jpg"
usually i renamed them randomly to avoid the same filenames when i grabbed it from internet...
So i want to upload them to the website and i want them arranged in good order....
Each folder should be ordered by numbers 1, 2, 3.....
Each folder has at most 39 files, 1.jpg, 2.jpg, .... 39.jpg
How can I do this?
So .... Super XP has provided batch file....
I 've done a little programming, it is fun!
******* save the following as .BAT file and modify vars as needed **********
@echo off
set cc=0
set dd=1
set od=D:\1
set td=D:\2
set nn=39
set ex=jpg
cls
echo.
echo Windows XP Batch file
echo Created by Zhihua Lai, 2007-Aug-30
echo The program can move all the %ex% files in %od% folder into
echo %td% folder and rename it by number
echo each folder (also labeled as number %dd% var) contains at most
echo %nn% pictures....
echo.
echo Press any key to continue, press Ctrl-C to exit....
pause >nul
rem cls
if not exist %td% mkdir %td% && echo %td% created...
for /f "usebackq delims==" %%i in (`dir /s /b %od%\*.%ex%`) do (
call :dothing "%%i"
)
goto :clear
:dothing
if exist "%1\nul" goto :end
if not exist "%td%\%dd%" mkdir "%td%\%dd%" && echo "%td%\%dd%" created...
set /a cc=cc+1 >nul
move %1 "%td%\%dd%\%cc%.jpg"
echo %1 has been moved to "%td%\%dd%\%cc%.jpg"!!!!
if /i "%cc%" EQU "%nn%" set /a cc=0 && set /a dd=dd+1
goto :end
:clear
set cc=
set dd=
set od=
set td=
set nn=
set ex=
:end
![定阅此目录的博客 定阅此目录的博客](/images/form/rss.gif)
猜您喜欢...
- Palindrome Integers
- Binary Tree Level with Minimum Sum
- Algorithm Interview: Maximum Path Sum in Binary Tree
- Spectrum Master
- A trick for getting good at coding interviews FASTER
- Linode Support Ticket 10029540 - Other - Important Notice Regarding Ubuntu 17.10 Image
- Patterns for breaking down questions you haven
- Daily Interview Problem:Create a balanced binary search tree
- [Daily Problem] Angles of a Clock
- Progess made
©2006~2024 牛排过熟 - 0.00823 秒 - 2345.079 KB/s - 15 在线
内存: 494.69 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - 服务器 PHP 版本号: 7.4.33
牛排怎么做才好吃? | <meta name="机器人" content="索引, 跟踪">
![](/images/top.jpg)
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - 服务器 PHP 版本号: 7.4.33
读写完全 - 一般 - 最小 - 表格 - 所有评论 - 统计
当前页暂时没有评论。