![]() |
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-10 18:04 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » How to represent a progress status with "\-/"? |
| Printable Version 25,919 / 57 |
| Floor1 kawakumo | Posted 2006-10-30 15:40 |
| 初级用户 Posts 9 Credits 32 | |
|
In batch processing, you want to use "\-/" to represent a progress status, as if the "-" is rolling. How to achieve this?
|
|
| Floor2 不得不爱 | Posted 2006-10-30 20:43 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
Do you mean that DOS commands are generally executed while displaying progress?
|
|
| Floor3 youxi01 | Posted 2006-10-30 21:55 |
| 高级用户 Posts 247 Credits 846 From 湖南==》广东 | |
|
@echo off
set str=\-/- setlocal enabledelayedexpansion :test for /l %%i in (-1 1 3) do ( set /p=!str:~%%i,1!<nul ping /n 2 127.1>nul) cls goto :test pause>nul Can this code complete the task? If the delay of ping /n 2 127.1 is too long (about 2 seconds), please use other methods. |
|
| Floor4 redtek | Posted 2006-10-30 22:06 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
It's very similar to the processing of early compression software, wonderful~:) Add points to youxi01~:)
|
|
| Floor5 不得不爱 | Posted 2006-10-30 22:26 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
I'll also do one:
Second one: [ Last edited by qwe1234567 on 2006-10-30 at 10:34 PM ] |
|
| Floor6 redtek | Posted 2006-10-30 22:39 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
Originally posted by 9527 at 2006-10-30 22:23: So the original poster wanted a fun animation~ : ) The rotating effect can still be achieved. I think there's nothing that can't be done : ) Not only rotation, but also word processing, inserting characters, modifying... : ) (Need to use ASCII code special control characters : ) Added a backspace function based on the code of moderator qwe1234567兄~ : ) ====================== Note: Please don't directly use the method of COPY CON filename.bat to COPY, ====================== Because the following code has special control characters, direct copy won't copy properly. ====================== Simple method: COPY to Windows Notepad, then save as a batch file, then execute. "The rotating effect can't be achieved with P processing", it's achieved, hehehe... [ Last edited by redtek on 2006-10-30 at 10:58 PM ] |
|
| Floor7 redtek | Posted 2006-10-30 22:48 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
You must not have tried it; it's definitely an effect of spinning (in place)!
LZ: "In batch processing, I want to use "\-/" to represent a progress status, it seems like the "-" is rolling", absolutely this kind of effect:) After each character is displayed, it moves back one space, and then displays again, (many command-line software prompts are based on this principle!) In this way, due to the speed and the visual difference of people, an animation effect (similar to spinning) will be produced, the same as the processing effect animation of early compression software. [ Last edited by redtek on 2006-10-30 at 10:51 PM ] |
|
| Floor8 redtek | Posted 2006-10-30 22:54 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Wait, I copied the code wrong, there are several here, I got confused, but the spin effect really works, wait a minute.
|
|
| Floor9 redtek | Posted 2006-10-30 22:56 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Wait,...... I looked again, it's not that I copied wrong!
You must have directly used COPY CON filename.bat in the CMD SHELL to copy the above code,! So, the "backspace" there = what I put later is the special control character for backspace, So, when you copy, it actually generates the backspace key, and the backspace symbol here you can't copy. (You directly copy to Notepad and then save it, it's fine!) (Originally, when copying the above content directly with copy con filename.bat, the system translated that backspace character as really backspacing by two spaces, causing the variable assignment statement to be incomplete) Apologize to 9527, it was originally this reason, haha...... [ Last edited by redtek on 2006-10-30 at 11:08 PM ] |
|
| Floor10 redtek | Posted 2006-10-30 23:00 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Direct download, batch animation code for rotating in place.
Attachments q.rar (295 bytes) |
|
| Floor11 youxi01 | Posted 2006-10-31 00:37 |
| 高级用户 Posts 247 Credits 846 From 湖南==》广东 | |
|
Brother, I'm not very smart. Can you tell me:
rem The ASCII code 08 is the backspace special control character set 退格= How is the backspace obtained here? |
|
| Floor12 redtek | Posted 2006-10-31 01:15 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
) First method:
Using the ECIT.COM editor built into MS-DOS (also available in WINDOWS CMD SHELL) to enter special control characters. Enter EDIT.COM, press the CTRL+P combination key, and then you can enter special characters: For example: The ASCII code of the backspace key (to move the cursor to the left) is 08, Then you can press ALT+08 (hold down the ALT key, then press the 0 and 8 keys on the right small keyboard, release the ALT key after both are entered. Note: CTRL+P is only effective once. If you enter the second control character, you have to press CTRL+P again ) Second method: Get it with Debug ) For special control characters like backspace, if you enter ALT+08 directly on the command line, it will "execute" immediately, which is equivalent to you pressing the backspace and deleting the content on the left. So, it is more convenient to enter it indirectly in edit.com or other ways. ) For 07 (ringing bell), you can enter GTRL+G or ALT+07 on the command line. ) For other control characters, refer to the ASCII code table Refer to the following post for more detailed content... DOS Learning Introduction & Wonderful Articles (Teaching Room) » ASCII Code Table and Meaning http://www.cn-dos.net/forum/viewthread.php?tid=1641&fpage=1&highlight=ascii%E7%A0%81 [ Last edited by redtek on 2006-10-31 at 01:30 AM ] |
|
| Floor13 youxi01 | Posted 2006-10-31 01:24 |
| 高级用户 Posts 247 Credits 846 From 湖南==》广东 | |
|
Many thanks
|
|
| Floor14 3742668 | Posted 2006-10-31 01:33 |
| 荣誉版主 Posts 718 Credits 2,013 | |
|
3, Use VBS:
Regarding the problem of this topic, actually, it was mentioned in an early reprinted post in this section ("In-depth Exploration of Windows Script Technology"). Now it seems that relatively few friends have understood it. |
|
| Floor15 redtek | Posted 2006-10-31 01:49 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
ASCII code tables and related content are detailed in the following posts ~:)
ASCII Code Table and Its Meaning http://www.cn-dos.net/forum/viewthread.php?tid=1641&fpage=1&highlight=ascii%E7%A0%81 ASCII Encoding Table http://www.cn-dos.net/forum/viewthread.php?tid=18942&fpage=1&highlight=ASCII Viewing ASCII Code Star Wars in DOS Interface http://www.cn-dos.net/forum/viewthread.php?tid=23874&fpage=1&highlight=ASCII Brief Analysis of Helpless Signature Code http://www.cn-dos.net/forum/viewthread.php?tid=18838&fpage=1&highlight=%E6%97%A0%E5%A5%88%E4%BD%95 Posts related to ASCII code and more advanced posts about ANSI animations, drawings, and defining keyboards are as follows: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Use of ANSI.SYS Program http://www.cn-dos.net/forum/viewthread.php?tid=1272&fpage=1&highlight=ANSI Achieve Color Screen Display Effects Without ANSI Driver in CONFIG http://www.cn-dos.net/forum/viewthread.php?tid=22025&fpage=1&highlight=ANSI RAR Supports ANSI Escape Characters http://www.cn-dos.net/forum/viewthread.php?tid=21800&fpage=1&highlight=ANSI (As above: RAR supports ANSI escape characters) ( Can make personalized copyrights of your own website's RAR compressed packages and content declarations, etc.) ( Can indirectly use this built-in feature of RAR to simply learn ANSI - in an environment without pure DOS) ( Can indirectly draw favorite images, etc.) ( For content about ANSI drawing, many tools can be retrieved on gOOGLE.com) ( At the same time, tools for converting BMP image files to ANSI character maps can also be retrieved...) [ Last edited by redtek on 2006-10-31 at 05:29 AM ] |
|
| 1 2 3 4 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |