![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-09-23 14:01 |
共 47,812 主题排行 / 349,917 发帖 / 今日 0 篇 / 48,273 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » 用WBAT和GET,FIND写的创建新的多层带间隔的长名目录小批处理: |
| 可打印版本 1,540 / 0 |
| 第1楼 GOTOmsdos | 发表于 2005-04-19 00:00 |
| 铂金会员 发帖 1,827 积分 5,154 | |
|
用WBAT和GET,FIND写的创建新的多层带间隔的长名目录小批处理: 这段时间,做综合游戏启动光盘,想实现创建新的多层带间隔的长名目录,需要命令行自动的.,但是又找不到适合的程序,所以就用WBAT和GET,FIND写的创建带间隔的长名目录小批处理: 供参考,
在纯DOS运行成功..,在XP DOS窗口可能不行...(经测试,可以建105个字符(包括"\" 的带间隔多层目录, 但\前后不能有间隔,WBAT BOX 可以显示120之内的字符,包括按钮)要求: 加载了DOSLFN echo off cls goto begin :lfn "to create long name folder with spaces !" please input folder name to creat: : :begin call w.bat box @%0:lfn if errorlevel 100 goto final if not "%lfn%"=="" goto go wbat box "no input yet ! input ?" input,exit if errorlevel 2 goto final goto begin :go if errorlevel 2 goto create wbat box "%lfn%" continue... :create get z "%lfn%" 1 dir "%lfn%" /w/ad|find "%get%" if not errorlevel 1 goto final md "%lfn%" get z "%lfn%" 1 dir "%lfn%" /w/ad|find "%get%" if not errorlevel 1 goto final :start set pos= set left=%lfn% set right= :toleft wbat box "to search existing directory by allocating '\'" continue... get # "%left%" '\' /x set pos=%get% get z "%lfn%" %pos% set right=%get% get r "-" %pos% /w1 get z "%left%" /w%get% set left=%get% wbat box "checking^%left%" continue... get z "%left%" 1 dir "%left%" /w/ad|find "%get%" if not errorlevel 1 goto exist wbat box "%left%^doesn't exist!" continue... goto toleft :exist wbat box "%left%^exists!" continue... goto make :toright wbat box "succeeded!" continue... :make wbat box "now about to create new directory to right!" continue... if "%right%"=="" goto end get # "%right%" '\' if "%get%"=="0" goto last get r "+" %pos% /w%get% set pos=%get% get r "-" %pos% /w1 get z "%lfn%" /w%get% set left=%get% get z "%lfn%" %pos% set right=%get% wbat box "creating^%left%" continue... md "%left%" wbat box "checking if succeeded" continue... get z "%left%" 1 dir "%left%" /w/ad|find "%get%" if not errorlevel 1 goto toright goto fail :last md "%lfn%" :end get z "%lfn%" 1 dir "%lfn%" /w/ad|find "%get%" if not errorlevel 1 goto ok :fail wbat box "FAIL creating new directory !!" retry,back if errorlevel 2 goto final goto start kwbat box "SUCCEEDED creating ENTIRE directory !!" finish :final |
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |