![]() |
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-29 08:05 |
47,816 topics / 349,916 posts / today 0 new / 48,265 members |
| DOS批处理 & 脚本技术(批处理室) » How to prevent users from closing the running CMD window [Completed] |
| Printable Version 6,609 / 27 |
| Floor1 HUNRYBECKY | Posted 2006-12-30 00:06 |
| 银牌会员 Posts 442 Credits 1,179 | |
|
Running a CMD batch program, to prevent users from accidentally or midway closing the CMD window, how to prohibit this behavior of users?
This problem has been perfectly solved, please refer to my answer on the 15th floor [ Last edited by HUNRYBECKY on 2007-1-18 at 08:50 AM ] |
|
| Floor2 zh159 | Posted 2006-12-30 00:27 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
Variant ^_^:
If the mouse and keyboard are USB, it's easy. Uninstall the USB mouse and keyboard hardware (don't uninstall the keyboard if you need keyboard selection), scan them back after the operation is over http://www.cn-dos.net/forum/viewthread.php?tid=25634 |
|
| Floor3 everest79 | Posted 2006-12-30 01:06 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
It seems that there is a function to lock the mouse and keyboard in VBS.
|
|
| Floor4 zh159 | Posted 2006-12-30 01:12 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
Originally posted by everest79 at 2006-12-29 12:06: Where is it? I also wanted to find it before but didn't find it. There was a batch script before that could only lock the mouse by operating Notepad through VBS. Later, I found a way to modify it all in the batch script, so I didn't need to use VBS. |
|
| Floor5 everest79 | Posted 2006-12-30 01:17 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
Have you ever used a key macro tool made with VBS?
|
|
| Floor6 zh159 | Posted 2006-12-30 01:44 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
| Floor7 everest79 | Posted 2006-12-30 01:56 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
Now I don't have it in hand either. The game I used to play for auto-fighting used it. It can limit the mouse within a certain area and can also intercept keyboard operations. It's just a VBA file.
|
|
| Floor8 HUNRYBECKY | Posted 2007-01-03 03:02 |
| 银牌会员 Posts 442 Credits 1,179 | |
|
VBA files are secondary development files and must be started with relevant programs.
|
|
| Floor9 HUNRYBECKY | Posted 2007-01-03 03:06 |
| 银牌会员 Posts 442 Credits 1,179 | |
Originally posted by zh159 at 2006-12-30 00:27: |
|
| Floor10 fage | Posted 2007-01-08 04:43 |
| 新手上路 Posts 1 Credits 2 | |
Originally posted by HUNRYBECKY at 2006-12-20 11:06 AM: How to achieve it??? I also urgently want to know, please expert guide!!! |
|
| Floor11 chainliq | Posted 2007-01-08 04:53 |
| 高级用户 Posts 244 Credits 635 From 广西贵港 | |
|
Well, I also want to use this effect. I hope experts can answer. It would be easy if I can block that "Close" button.
|
|
| Floor12 qasa | Posted 2007-01-08 06:41 |
| 高级用户 Posts 311 Credits 959 From 广东-LianJiang | |
Originally posted by chainliq at 2007-1-8 04:53: If that's the case, it can only be achieved by rewriting the system's DLL files. |
|
| Floor13 zhoung0 | Posted 2007-01-08 08:56 |
| 初级用户 Posts 18 Credits 54 | |
|
You can try autoit
Opt("WinTitleMatchMode", 4) ShellExecute("ping.bat") Sleep (1000) WinSetState ( "classname=ConsoleWindowClass", "", @SW_DISABLE ) [ Last edited by zhoung0 on 2007-1-8 at 09:14 AM ] |
|
| Floor14 yardian | Posted 2007-01-08 11:04 |
| 中级用户 Posts 85 Credits 305 | |
|
Encrypt CMD so that even if the computer overflows, you can't get CMD permissions
|
|
| Floor15 HUNRYBECKY | Posted 2007-01-18 08:48 |
| 银牌会员 Posts 442 Credits 1,179 | |
|
Finally found the answer. My computer is a DEEPIN slim version. A few days ago, I accidentally found a CMDOW.exe file during antivirus scanning, which was said to be a trojan. I checked online and found that many GHOST and slim systems have this file, and many people also found it to be a trojan or virus when checked, but it was finally determined that this tool is not a virus or trojan and can be used with confidence.
The CMDNOW tool is very powerful, specially used to handle DOS or non-DOW windows. You can add CMDOW.EXE @ /DIS at the beginning of the batch processing to prohibit changing the window. To hide the window, use CMDOW.EXE @ /HID. This command can be downloaded from http://commandline.co.uk. The English help of this tool is as follows: CMDOW Win32 Commandline Window Utility for NT4/2000/XP. (C) Copyright 2001-2004 Ritchie Lawrence, http://www.commandline.co.uk. CMDOW CMDOW /TH | /TV | /MA | /CW | /UW | /AT | /FS | /WM CMDOW window { } CMDOW /RUN file window List specified window (if omitted, all windows are listed). /T List windows only shown on the taskbar. /B List windows using bare format (no heading information). /F List windows showing full information (don't truncate any fields). /P List windows showing position and size (left, top, width and height). /TH Tile windows horizontally. /TV Tile windows vertically. /MA Minimize all windows. /CW Cascade windows. /UW Undo tile/minimize/cascade. /AT Intelligent - /FS Switch to full screen mode. /WM Switch to window mode. /ACT Activate specified window. /INA Inactivate specified window. /ENA Enable specified window. /DIS Disable specified window. /VIS Unhide specified window. /HID Hide specified window. /MIN Minimize specified window. /MAX Maximize specified window. /RES Restore specified window. /REN Rename specified window. /TOP Make window always on top. /NOT Make window not always on top. /MOV Move specified window. /SIZ Resize specified window. /CLS Close specified window. /END Kill process linked to window. /RUN Executes or opens specified file using associated application. state Initial show state of window (/MIN, /MAX or /HID). Default is normal. args Optional commandline arguments passed to launched application. Specify a window by its caption (case insensitive) or handle in hex format. The At symbol '@' may be used to refer to this window. For more help on any parameter use CMDOW /? <parameter>. Eg CMDOW /? /RUN or CMDOW /? window. |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |