批处理隐藏运行的11种思路
来源:互联网 发布:sap84软件购买 编辑:程序博客网 时间:2024/04/28 15:53
[原创] [方案汇总]批处理隐藏运行的11种思路(2009-04-18)
1.基础
HideRun.vbs 其中D:\test.bat是你的批处理路径
HideRun.bat 这个批处理其实不能使其批处理本身隐藏,但是下面大部分隐藏调用批处理的原理和基础。
HideRun.js 用Javascript有什么好处呢?js的字符串变量可以用单引号,从而方便命令行作为参数调用,而且js很好的支持多行语句用 ; 分隔写成一行。要注意的是:js要区分大小写,方法必须用括号,结尾必须有分号。所以就成了下面的命令:2.用快捷方式
如果要使一个批处理本身隐藏,可以参考附件里的一个快捷方式,修改附件中的相关路径即可隐藏启动你的批处理。可以用vbs来建立一个 .lnk,其实用批处理也行(先echo一个vbs出来)
3.利用系统服务
可以用sc建立一个系统服务然后启动这个服务来启动批处理。缺点是启动服务较慢,需要管理员权限
查考这个帖子,
http://www.cn-dos.net/forum/viewthread.php?tid=21426
asbai 兄的大作,极大的方便了我们的使用。4.利用at计划任务
用at可以建立一个计划任务,在不输入 /interactive 参数可以后台运行。但是建使用at必须有管理员权限 然后在 9:10 系统就会自动后台以SYSTEM权限运行这个bat
5.利用ftype文件关联
综合上面的技术,使所有批处理都隐藏运行 大家可以讨论下下面的思路,目前没有明确的方法,但是理论上是可行的
6.rundll32
其实这个方法只是理论上估计的,这里提出来占个位置,留个记号,等待高手研究
rundll32可以调用 dll 里的API,如果有个dll可以隐藏run一个exe就可以实现隐藏启动批处理,呵呵。目前我也没找到方法。
7.其他用户
Windows 2k/XP支持多用户,如果能在后台登陆另一个账户的桌面然后运行一个批处理,就能完全达到隐藏的目的
8.bat2vbs
这个方法只是一个不是很成熟的思路。
查考这个帖子:
http://www.cn-dos.net/forum/viewthread.php?tid=20769
这使我们产生了一个想法:把bat转换成vbs,然后vbs生成一个临时bat文件,然后WScript.Shell.Run隐藏启动这个临时bat
9. .NET编译
参考这个帖子:
http://www.cn-dos.net/forum/viewthread.php?tid=23374
里面提到了一个 .NET Warpper,我们完全可以利用系统自带的组件把bat编译到 exe 当中。如果bat不涉及交互,exe自然就安静的运行了。
10.注入汇编
最后向大家推出的今天最隆重的,ASCII Assembly Code专家 Herbert Kleebauer 的又一力作:showwin.exe
showwin.exe let you minimize/maximize/hide the command window
within a batch program (requires W2k or better).
Usage: showwin.exe number
0 SW_HIDE
Hides the window and activates another window.
1 SW_SHOWNORMAL
Activates and displays a window. If the window is minimized or maximized,
the system restores it to its original size and position. An application
should specify this flag when displaying the window for the first time.
2 SW_SHOWMINIMIZED
Activates the window and displays it as a minimized window.
3 SW_MAXIMIZE
Maximizes the specified window.
3 SW_SHOWMAXIMIZED
Activates the window and displays it as a maximized window.
4 SW_SHOWNOACTIVATE
Displays a window in its most recent size and position. This value is
similar to SW_SHOWNORMAL, except the window is not actived.
5 SW_SHOW
Activates the window and displays it in its current size and position.
6 SW_MINIMIZE
Minimizes the specified window and activates the next top-level window
in the Z order.
7 SW_SHOWMINNOACTIVE
Displays the window as a minimized window. This value is similar to
SW_SHOWMINIMIZED, except the window is not activated.
8 SW_SHOWNA
Displays the window in its current size and position. This value is
similar to SW_SHOW, except the window is not activated.
9 SW_RESTORE
Activates and displays the window. If the window is minimized or maximized,
the system restores it to its original size and position. An application
should specify this flag when restoring a minimized window.
10 SW_SHOWDEFAULT
Sets the show state based on the SW_ value specified in the STARTUPINFO
structure passed to the CreateProcess function by the program that
started the application.
11 SW_FORCEMINIMIZE
Windows 2000/XP: Minimizes a window, even if the thread that owns the
window is not responding. This flag should only be used when minimizing
windows from a different thread.
---------------------------------------------------------------------------
A simple example: 原帖地址在
http://groups.google.com/group/a ... ad/b30d93c7f43b6731
问题是我后脸皮发的。嘿嘿
不过我还没有测试成功。估计是keyboard layout和language/code page不同造成的
以上10中思路原文地址:http://www.cn-dos.net/forum/viewthread.php?tid=23846
11、第三方命令行工具nircmd.exe 下载地址:http://bbs.bathome.net/thread-3981-1-1.html
[ 本帖最后由 Batcher 于 2009-4-18 15:04 编辑 ]
HideRun.vbs 其中D:\test.bat是你的批处理路径
HideRun.bat 这个批处理其实不能使其批处理本身隐藏,但是下面大部分隐藏调用批处理的原理和基础。
HideRun.js 用Javascript有什么好处呢?js的字符串变量可以用单引号,从而方便命令行作为参数调用,而且js很好的支持多行语句用 ; 分隔写成一行。要注意的是:js要区分大小写,方法必须用括号,结尾必须有分号。所以就成了下面的命令:2.用快捷方式
如果要使一个批处理本身隐藏,可以参考附件里的一个快捷方式,修改附件中的相关路径即可隐藏启动你的批处理。可以用vbs来建立一个 .lnk,其实用批处理也行(先echo一个vbs出来)
3.利用系统服务
可以用sc建立一个系统服务然后启动这个服务来启动批处理。缺点是启动服务较慢,需要管理员权限
查考这个帖子,
http://www.cn-dos.net/forum/viewthread.php?tid=21426
asbai 兄的大作,极大的方便了我们的使用。4.利用at计划任务
用at可以建立一个计划任务,在不输入 /interactive 参数可以后台运行。但是建使用at必须有管理员权限 然后在 9:10 系统就会自动后台以SYSTEM权限运行这个bat
5.利用ftype文件关联
综合上面的技术,使所有批处理都隐藏运行 大家可以讨论下下面的思路,目前没有明确的方法,但是理论上是可行的
6.rundll32
其实这个方法只是理论上估计的,这里提出来占个位置,留个记号,等待高手研究
rundll32可以调用 dll 里的API,如果有个dll可以隐藏run一个exe就可以实现隐藏启动批处理,呵呵。目前我也没找到方法。
7.其他用户
Windows 2k/XP支持多用户,如果能在后台登陆另一个账户的桌面然后运行一个批处理,就能完全达到隐藏的目的
8.bat2vbs
这个方法只是一个不是很成熟的思路。
查考这个帖子:
http://www.cn-dos.net/forum/viewthread.php?tid=20769
这使我们产生了一个想法:把bat转换成vbs,然后vbs生成一个临时bat文件,然后WScript.Shell.Run隐藏启动这个临时bat
9. .NET编译
参考这个帖子:
http://www.cn-dos.net/forum/viewthread.php?tid=23374
里面提到了一个 .NET Warpper,我们完全可以利用系统自带的组件把bat编译到 exe 当中。如果bat不涉及交互,exe自然就安静的运行了。
10.注入汇编
最后向大家推出的今天最隆重的,ASCII Assembly Code专家 Herbert Kleebauer 的又一力作:showwin.exe
showwin.exe let you minimize/maximize/hide the command window
within a batch program (requires W2k or better).
Usage: showwin.exe number
0 SW_HIDE
Hides the window and activates another window.
1 SW_SHOWNORMAL
Activates and displays a window. If the window is minimized or maximized,
the system restores it to its original size and position. An application
should specify this flag when displaying the window for the first time.
2 SW_SHOWMINIMIZED
Activates the window and displays it as a minimized window.
3 SW_MAXIMIZE
Maximizes the specified window.
3 SW_SHOWMAXIMIZED
Activates the window and displays it as a maximized window.
4 SW_SHOWNOACTIVATE
Displays a window in its most recent size and position. This value is
similar to SW_SHOWNORMAL, except the window is not actived.
5 SW_SHOW
Activates the window and displays it in its current size and position.
6 SW_MINIMIZE
Minimizes the specified window and activates the next top-level window
in the Z order.
7 SW_SHOWMINNOACTIVE
Displays the window as a minimized window. This value is similar to
SW_SHOWMINIMIZED, except the window is not activated.
8 SW_SHOWNA
Displays the window in its current size and position. This value is
similar to SW_SHOW, except the window is not activated.
9 SW_RESTORE
Activates and displays the window. If the window is minimized or maximized,
the system restores it to its original size and position. An application
should specify this flag when restoring a minimized window.
10 SW_SHOWDEFAULT
Sets the show state based on the SW_ value specified in the STARTUPINFO
structure passed to the CreateProcess function by the program that
started the application.
11 SW_FORCEMINIMIZE
Windows 2000/XP: Minimizes a window, even if the thread that owns the
window is not responding. This flag should only be used when minimizing
windows from a different thread.
---------------------------------------------------------------------------
A simple example: 原帖地址在
http://groups.google.com/group/a ... ad/b30d93c7f43b6731
问题是我后脸皮发的。嘿嘿
不过我还没有测试成功。估计是keyboard layout和language/code page不同造成的
以上10中思路原文地址:http://www.cn-dos.net/forum/viewthread.php?tid=23846
11、第三方命令行工具nircmd.exe 下载地址:http://bbs.bathome.net/thread-3981-1-1.html
[ 本帖最后由 Batcher 于 2009-4-18 15:04 编辑 ]
0 0
- 批处理隐藏运行的11种思路
- 批处理隐藏运行的10种思路
- 几种隐藏批处理运行窗口的方法
- 隐藏运行批处理时出现的黑框
- 隐藏 运行批处理(bat)的命令行(cmd)窗口
- 隐藏批处理bat黑框运行的小工具
- 批处理命令--隐藏运行多程序
- 批处理计算时间的思路
- 管理员权限运行批处理的几种方法
- 如何在运行批处理时隐藏cmd窗口
- shellcode的隐藏运行
- win 7 管理员权限运行批处理的几种方法
- Linux进程隐藏的一种实现思路
- 用批处理运行可执行的的jar
- 用批处理运行可执行的的jar
- 批处理运行多个程序的方法
- Unix Shell中运行批处理的方法
- 一天只允许运行一次的批处理
- Git 常用命令
- oracle11g 配置监听及登录问题解决方案
- 百度站长平台显示连接超时次数
- 判断浏览器
- 对于混淆C#代码,你们有啥建议吗?
- 批处理隐藏运行的11种思路
- JS组件系列——表格组件神器:bootstrap table(一)
- 一个漂亮的干货集中营客户端的生成,集合了干货api的大部分功能
- hadoop的安装
- Android 顶部悬停
- 建立 索引常用的规则
- 阿拉伯语状态下TextView如何从右往左显示
- enjoy summer the many year
- 矩阵求逆