|
uiopuiop
中级用户
  
积分 400
发帖 211
注册 2007-9-30
状态 离线
|
『楼 主』:
如何禁用CMD窗口的关闭按钮
使用 LLM 解释/回答一下
看到过一个脚本能把CMD窗口的关闭按钮变灰掉,防止有人关闭窗口。
Last edited by uiopuiop on 2008-9-14 at 02:48 PM ]
Saw a script that can gray out the close button of the CMD window to prevent someone from closing the window.
Last edited by uiopuiop on 2008-9-14 at 02:48 PM ]
|
|
2008-9-14 14:14 |
|
|
uiopuiop
中级用户
  
积分 400
发帖 211
注册 2007-9-30
状态 离线
|
『第 2 楼』:
看到一帖,问题解决了。
使用 LLM 解释/回答一下
http://www.cn-dos.net/forum/viewthread.php?tid=39745&fpage=1&highlight=CMD%E7%AA%97%E5%8F%A3%2B%E5%85%B3%E9%97%AD%E6%8C%89%E9%92%AE
就是不知道是否还有什么其他的办法,不用GRAY.EXE也可以做到,呵呵。。
@echo off
start /b gray.exe
echo This is a test
echo.
REM 不杀gray.exe pause就没反应了,在怎么者也推不出来
taskkill /f /im gray.exe >nul
pause
GRAY一定要放到最后杀,杀了gray后能退出了,否则灰发现右键点击状态栏中的批处理时,X 又出现了。缺点就是grey.exe 不能自己退出(好像没什么参数)。taskkill /f /im gray.exe 会把所有的gray.exe 都杀掉,从而影响到其他应用次功能的窗口。
Last edited by uiopuiop on 2008-9-14 at 02:55 PM ]
http://www.cn-dos.net/forum/viewthread.php?tid=39745&fpage=1&highlight=CMD%E7%AA%97%E5%8F%A3%2B%E5%85%B3%E9%97%AD%E6%8C%89%E9%92%AE
Just don't know if there are any other ways, and it can be done without using GRAY.EXE, heh heh.
@echo off
start /b gray.exe
echo This is a test
echo.
REM If you don't kill gray.exe, the pause won't work, and it can't be pushed out no matter what
taskkill /f /im gray.exe >nul
pause
GRAY must be killed at the end. After killing gray, it can exit. Otherwise, when you right-click the batch processing in the status bar, the X will appear again. The shortcoming is that grey.exe can't exit by itself (it seems there are no parameters). taskkill /f /im gray.exe will kill all gray.exe, thus affecting the windows of other applications' secondary functions.
Last edited by uiopuiop on 2008-9-14 at 02:55 PM ]
附件
1: gray.zip (2008-9-14 14:45, 21.54 KiB,下载次数: 170)
|
|
2008-9-14 14:37 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
 『第 3 楼』:
AutoHotkey 脚本:
使用 LLM 解释/回答一下
1 HOUR SOFTWARE 里有个 NoClose, helfee 将其修改成了 命令行版本。
用法:
Disable 标题为 C:\WINDOWS 的窗口:
x.exe /dC:\WINDOWS
Enable 标题为 C:\WINDOWS 的窗口:
x.exe /eC:\WINDOWS
Disable 类名为 CabinetWClass 的窗口:
x.exe /dahk_classCabinetWClass
标题或类名带空格,一定要加双引号:
x.exe "/dC:\Program Files"
同时处理 N 个窗口:
x.exe /dC:\WINDOWS /eC:\WINDOWS\system32 "/dC:\Program Files" /dahk_classConsoleWindowClass
下载地址: http://good.gd/26048.htm
http://upload.cn-dos.net/img/930.zip
───────────────── 版务记录 ─────────────────
执行:HAT
操作:2008-10-11帮楼主上传附件
───────────────── 版务记录 ─────────────────
Last edited by tireless on 2008-10-12 at 17:03 ]
In the 1 HOUR SOFTWARE, there is a NoClose, and helfee has modified it into a command-line version.
Usage:
Disable the window titled C:\WINDOWS:
x.exe /dC:\WINDOWS
Enable the window titled C:\WINDOWS:
x.exe /eC:\WINDOWS
Disable the window with the class name CabinetWClass:
x.exe /dahk_classCabinetWClass
If the title or class name has spaces, you must add double quotes:
x.exe "/dC:\Program Files"
Process N windows simultaneously:
x.exe /dC:\WINDOWS /eC:\WINDOWS\system32 "/dC:\Program Files" /dahk_classConsoleWindowClass
Download address: http://good.gd/26048.htm
http://upload.cn-dos.net/img/930.zip
───────────────── Moderation Records ─────────────────
Executed: HAT
Operation: Uploaded attachment for the poster on 2008-10-11
───────────────── Moderation Records ─────────────────
Last edited by tireless on 2008-10-12 at 17:03 ]
|
|
2008-9-14 17:17 |
|
|
banalo
新手上路

积分 10
发帖 5
注册 2008-9-5
状态 离线
|
|
2008-9-14 17:24 |
|
|
uiopuiop
中级用户
  
积分 400
发帖 211
注册 2007-9-30
状态 离线
|
|
2008-9-14 18:03 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 6 楼』:
re 5 楼
使用 LLM 解释/回答一下
我也发觉了,其他窗口没这个问题。
虽然没有变灰,但还是关闭不了的。
I also noticed that other windows don't have this problem. Although it's not grayed out, it still can't be closed.
|
|
2008-9-14 18:24 |
|
|
uiopuiop
中级用户
  
积分 400
发帖 211
注册 2007-9-30
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
这到是,谢了! 好东西!
VB就是代码多了点,这东西还加了壳 -203kb想把那个难看的图标删了都不行, 而gray.exe 只有56kb.
Last edited by uiopuiop on 2008-9-14 at 06:43 PM ]
Well, thanks! Great stuff!
VB has just too much code. This thing also has a shell - 203kb, and you can't even delete that ugly icon, while gray.exe is only 56kb.
Last edited by uiopuiop on 2008-9-14 at 06:43 PM ]
|
|
2008-9-14 18:36 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by uiopuiop at 2008-9-13 10:36 PM:
这到是,谢了! 好东西!
VB就是代码多了点,这东西还加了壳 -203kb, gray.exe 只有56kb.
不是加壳。这是用 AutoHotkey 编的脚本,后缀名为 .ahk,如果你电脑里装了 AutoHotkey,直接用 x.ahk 就行了。
把 x.ahk 编译成 x.exe 就这么个大小了,我加了个图标后大小为 203 KB,不加图标的话 198 kb。
Originally posted by uiopuiop at 2008-9-13 10:36 PM:
That's right, thanks! Great stuff!
VB has just too much code. This thing is also packed - 203kb, gray.exe is only 56kb.
It's not packed. This is a script compiled with AutoHotkey, with the extension .ahk. If you have AutoHotkey installed on your computer, you can directly use x.ahk.
Compiling x.ahk into x.exe results in this size. After I added an icon, the size is 203 KB, and without an icon, it's 198 kb.
|
|
2008-9-14 18:41 |
|
|
uiopuiop
中级用户
  
积分 400
发帖 211
注册 2007-9-30
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
Originally posted by tireless at 2008-9-14 06:41 PM:
不是加壳。这是用 AutoHotkey 编的脚本,后缀名为 .ahk,如果你电脑里装了 AutoHotkey,直接用 x.ahk 就行了。
把 x.ahk 编译成 x.exe 就这么个大小了,我加了个图标后大小为 203 KB,不加图标的话 198 kb。
能编译个不加图标的EXE上来吗?谢了!
Originally posted by tireless at 2008-9-14 06:41 PM:
It's not a packed shell. This is a script compiled with AutoHotkey, with the file extension .ahk. If you have AutoHotkey installed on your computer, you can just use x.ahk directly.
When you compile x.ahk into x.exe, it's just this size. After I added an icon, the size is 203 KB, and without an icon, it's 198 KB.
Can you compile an icon-free EXE and upload it? Thanks!
|
|
2008-9-14 18:45 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
|
2008-9-14 18:49 |
|
|
uiopuiop
中级用户
  
积分 400
发帖 211
注册 2007-9-30
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
想用来做域登陆脚本,原来的那个图标太难看了。exe 越小越好,copy起来快点。你现在那个还是带个H的图标 :^)
Last edited by uiopuiop on 2008-9-14 at 06:54 PM ]
I want to use it as a domain login script, the original icon is too ugly. The exe should be as small as possible, copy faster. The one you have now still has an icon with an H :^)
Last edited by uiopuiop on 2008-9-14 at 06:54 PM ]
|
|
2008-9-14 18:52 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
Originally posted by uiopuiop at 2008-9-13 10:52 PM:
想用来做域登陆脚本,原来的那个图标太难看了。exe 越小越好,copy起来快点。你现在那个还是带个H的图标 :^)
Last edited by uiopuiop on 2008-9-14 at 06:54 PM ]
我可是截屏后,动用 Photoshop,放大后仔细裁剪成 png,然后用 png2ico 转换的...因为我觉得还是留点边界好看一点。
H的图标是 AutoHotkey 自带的。我试了用 Resource Hacker 把那些图标去掉,貌似会出错。。
Originally posted by uiopuiop at 2008-9-13 10:52 PM:
Want to use it as a domain login script. The original icon is too ugly. The smaller the exe, the better, so it copies faster. Your current one still has a H icon :^)
Last edited by uiopuiop on 2008-9-14 at 06:54 PM ]
I took a screenshot, then used Photoshop, enlarged it and carefully cropped it into a png, and then converted it with png2ico... because I think it looks better to leave some borders.
The H icon is the one that comes with AutoHotkey. I tried using Resource Hacker to remove those icons, but it seemed to have errors.
|
|
2008-9-14 18:58 |
|
|
uiopuiop
中级用户
  
积分 400
发帖 211
注册 2007-9-30
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
辛苦了 :) 哈哈
以前只知道AUTOIT,又学东西了。
You've worked hard :) Haha. I only knew AUTOIT before, and now I'm learning something new.
|
|
2008-9-14 19:25 |
|
|
yangjunxx
新手上路

积分 7
发帖 5
注册 2009-1-8
状态 离线
|
|
2009-11-15 21:05 |
|
|
soyoung
新手上路

积分 2
发帖 2
注册 2010-12-23
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
好东西,先研究一下用法。
Good stuff, let's first study how to use it.
|
|
2010-12-24 15:19 |
|