![]() |
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-09-23 14:09 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » A question challenging DOS experts |
| Printable Version 1,737 / 12 |
| Floor1 xy2fengye | Posted 2005-08-13 15:14 |
| 初级用户 Posts 23 Credits 55 | |
|
How to automatically save and exit edit to the DOS program after entering edit and finishing writing the program. Simply put, in the DOS environment:
c:\edit 1.bat Write the program to be written (already in edit) Press alt+f-x to exit Complete it all at once with a batch file without manual intervention. It's equivalent to an automatic demonstration. |
|
| Floor2 GOTOmsdos | Posted 2005-08-13 16:40 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
Let's see, does EDIT have command-line parameters, and then try the > and < redirection characters. It doesn't seem like a big issue..
|
|
| Floor3 xy2fengye | Posted 2005-08-13 16:45 |
| 初级用户 Posts 23 Credits 55 | |
|
#83 What I want is this step, I must enter the edit interface. But still thank you
|
|
| Floor4 Climbing | Posted 2005-08-13 18:29 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
| Floor5 GOTOmsdos | Posted 2005-08-13 18:57 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
I just now saw and understood your meaning, this can't be possible..
Because EDIT must ask for saving, if you don't save and exit, it will pop up a box.. No matter in which way you open EDIT, at this time the process is under the control of the EDIT program,.. It's impossible to change its steps, especially in DOS. |
|
| Floor6 willsort | Posted 2005-08-13 19:25 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re xy2fengye:
In my opinion, the significance of doing this is not very great, so its challenge is reduced. Because EDIT is not a tool for processing text streams. It has a typical window menu interface, and uses menu commands to implement text editing. This is one of its advantages, and of course it may be a disadvantage, but this is still a technological advancement. We need to control text editing through automated scripts. EDIT has never been a good choice, and it is even difficult to be an option. For this aspect, EDLIN.EXE, a tool launched earlier by MS, is more competent. It used to be the love of batch processing enthusiasts and had a status similar to DEBUG.EXE. Although it once disappeared, you can still find and run it on NT series platforms such as XP now. Maybe it can help you unexpectedly with your problem. |
|
| Floor7 JonePeng | Posted 2005-08-13 21:03 |
| 金牌会员 Posts 1,883 Credits 4,562 From 广东广州 | |
|
To achieve the demonstration effect like the LZ, I thought of using KPUSH from the MSDOS 7.1 super boot disk. After a little test, it can be successful, but the shortcoming is that this demonstration has no delay effect, and the keyboard "action" is too fast, so that the edit interface flashes by in a flash.
I also had a small try on KPUSH in my previous post. In fact, the function of KPUSH is relatively powerful. It can send up to 127 characters into the keyboard buffer, and can simulate keyboard input at the command line. In the default state, the size of the keyboard buffer is 15 keys (can be regarded as 15 characters). Running kpush /e expands the buffer size to 127 keys. If the 1.bat file to be demonstrated by the LZ is not long, then these 127 keys are enough. Try the following commands: kpush /e kpush "edit 1.bat" 13 "@echo KPUSH demo program." 13 "@echo Returned to DOS prompt." /33 "xy" Explain: kpush /e -- expand the buffer size to 127 keys There are many parameters in the second line. In fact, these parameters are all characters and keyboard scan codes for simulation input. Among them, ordinary strings must be enclosed in quotes (single or double quotes are acceptable). "13" is the ASCII code of the enter key. The following "/33" is the scan code of the Alt+F combination key. For function keys such as combination keys, F1-F12, etc., you must use "/" followed by the scan code to distinguish the ASCII code of ordinary keys. The "xy" at the end means that after pressing Alt+F, press "x" first. At this time, the edit prompts whether to save the file, and then simulate pressing the "y" key to exit. To query the code or scan code of a certain key, you can directly run KPUSH and then press any key to see the result corresponding to the key. [ Last edited by JonePeng on 2005-8-13 at 21:05 ] |
|
| Floor8 Climbing | Posted 2005-08-13 21:13 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
The LZ doesn't want edlin. What he wants is Edit, for demonstration purposes, he wants to demonstrate to people how to use Edit to write a batch file (or other program).
Personally, I feel this is of no significance. If Edit supports macro functions similar to Office, this can be achieved. There are similar software under Windows, such as Automate. But under DOS, I haven't found any yet. |
|
| Floor9 willsort | Posted 2005-08-14 20:54 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re Climbing:
Instead of making automatic demonstrations of EDIT, it might be better to use a screen capture software to record the input process as a video or animation under the command line. Although it is a bit larger in size, it can avoid many compatibility issues, such as the situation where the environment does not support EDIT. But I don't know what screen recording software under DOS can directly record and generate self-display animations? |
|
| Floor10 xy2fengye | Posted 2005-08-14 21:31 |
| 初级用户 Posts 23 Credits 55 | |
|
Hello everyone. The reason I came up with this topic is like this. Because sometimes we don't want to always use edit (if you never use it) to open it, write a program, save - exit - confirm exit. It's really a bit troublesome. If we make a batch file, isn't it simple and saves a lot of things? By the way, what tools do you use to write batch files in DOS?
|
|
| Floor11 wqvbbjiq | Posted 2005-08-14 22:09 |
| 初级用户 Posts 20 Credits 24 | |
|
Because EDIT will ask for saving; if you don't save, it will exit, and it will pop up a box. No matter in which way you open EDIT, you can't change its steps. Use DOS.
|
|
| Floor12 willsort | Posted 2005-08-14 22:39 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re xy2fengye:
If you are referring to how to generate batch programs or text files in the command line or batch processing, you can refer to the following link: {16833}Several ways for dos commands to generate text files (*.txt) If you want to edit some files through batch processing, I still suggest using edlin, or using third-party provided tools such as sed. In addition, Debug also has a simple function to edit text. |
|
| Floor13 Climbing | Posted 2005-08-16 10:45 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
I use Edit to write things under DOS. I think it's quite easy to use, and it doesn't make people feel troublesome at all. If you find it troublesome, it seems that Bart's tool disk provides an Edit program. That program can directly press Alt+X to save and exit, and Alt+Q to exit without saving. Also, there seem to be editing tools like Qedit or Vim.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |