![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-03 11:42 |
48,038 topics / 350,123 posts / today 0 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] LXMXN, please take a look at this BAT |
| Printable Version 1,040 / 2 |
| Floor1 beeny | Posted 2007-02-03 09:54 |
| 初级用户 Posts 49 Credits 136 | |
|
I read brother LXMXN's BAT for cleaning up Tencent ads and tried writing one myself.
It still won't work, and I don't know what's wrong with the code below. Please kindly give me some advice! @echo off setlocal enabledelayedexpansion set /p path_=Please enter QQ's installation directory: if %path_%=="" set path_="D:\Program Files\Tencent\AD" for /f %%a in ('dir /ba-d "!path_!\*.gif" "!path_!\*.swf"') do( set name=%%~nxa & echo %name%>>name.txt ) |
|
| Floor2 lxmxn | Posted 2007-02-10 10:33 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Re beeny: " if %path_%=="" " here it's better to write it like this: " if "%path_%"=="" ". Also, there are two errors inside the parentheses of the for command. In " dir /ba-d ", these two parameters should be written separately: " dir /b /a-d ". Also, the variable inside the for parentheses doesn't need delayed expansion; you can just use %path_% directly. After that, following " set name= ", since delayed expansion is enabled, you should use " echo !name! ". Try modifying it according to these suggestions and see if it works. |
|
| Floor3 wlt2007 | Posted 2007-02-11 09:56 |
| 初级用户 Posts 20 Credits 42 | |
|
After reading it, I felt ashamed:
For many years I've only been reading (breaking?); at most I just write a BAT to help myself run some programs (stand?). The OP got into real combat so quickly, impressive! Even more impressive is brother lxmxn: doing even small good things! |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |