ybbihsse 发表于 2010-6-18 13:00:28

WIN2003任管管理器

我如何写一个知道客户端名,结束里面这个客户端名下的某个进程

yejier1983 发表于 2010-6-18 14:53:11

本帖最后由 yejier1983 于 2010-6-18 15:53 编辑

新手路过,先标记一下
不知道 还是知道?

chenronting 发表于 2010-6-19 20:22:15

远程的?我也不懂。不过你的问题没说清楚。 建议你先把问题写明白咯

ybbihsse 发表于 2010-6-20 09:32:17

就是像批处理一样的结束某个进程,taskkill 这个命令一样,就是根据那个客户端名,进行结束指定的进程

ybbihsse 发表于 2010-6-21 13:02:00

有人知道这样的指令吗

wxyyabc 发表于 2010-6-24 21:17:27

彬哥,你什么时候注册进来的啊!我才注册没几天啊!
下面看一下这个东东啊!也许可以帮上你了啊?
#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_UseAnsi=y                                                                        ;编码
#AutoIt3Wrapper_Icon=                                                                                 ;图标
#AutoIt3Wrapper_OutFile=                                                                        ;输出文件名
#AutoIt3Wrapper_OutFile_Type=exe                                                        ;文件类型
#AutoIt3Wrapper_Compression=4                                                                ;压缩等级
#AutoIt3Wrapper_UseUpx=y                                                                         ;使用压缩
#AutoIt3Wrapper_Res_Comment=                                                                 ;注释
#AutoIt3Wrapper_Res_Description=                                                        ;详细信息
#AutoIt3Wrapper_Res_Fileversion=                                                        ;文件版本
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p                                ;自动更新版本
#AutoIt3Wrapper_Res_LegalCopyright=                                                 ;版权
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer%                ;自定义资源段
;#AutoIt3Wrapper_Run_Tidy=                                                   ;脚本整理
;#AutoIt3Wrapper_Run_Obfuscator=                                                      ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check=                                                                 ;语法检查
;#AutoIt3Wrapper_Run_Before=                                                                 ;运行前
;#AutoIt3Wrapper_Run_After=                                                                        ;运行后
#EndRegion AutoIt3Wrapper 预编译参数设置完成
#cs ____________________________________

AutoIt 版本: 3.2.13.7 (第一版)
脚本作者:技术一良
        Email:wxyyabc@163.com
        QQ/TM:6598181
脚本版本:
脚本功能:

#ce _______________脚本开始_________________
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("终端用户管理器", 495, 409, 228, 156)
$List1 = GUICtrlCreateList("", 0, 56, 489, 136)
GUICtrlSetData(-1, "")
$List2 = GUICtrlCreateList("", 0, 256, 489, 136)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("终端用户", 192, 8, 73, 33, 0)
$Button2 = GUICtrlCreateButton("终端会话", 192, 208, 73, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $run = Run(@ComSpec & " /c query user", '', @SW_HIDE, $STDOUT_CHILD); 查看终端用户
                        ProcessWaitClose($run)
                        $string = StdoutRead($run)
                        $string = StringRegExpReplace($string, '\n', '|', 0)
                        GUICtrlSetData($List1, $string)
                Case $Button2
                        $run = Run(@ComSpec & " /c query session", '', @SW_HIDE, $STDOUT_CHILD); 查看终端会话
                        ProcessWaitClose($run)
                        $string = StdoutRead($run)
                        $string = StringRegExpReplace($string, '\n', '|', 0)
                        GUICtrlSetData($List2, $string)
      EndSwitch
WEnd

wxyyabc 发表于 2010-6-24 21:17:33

彬哥,你什么时候注册进来的啊!我才注册没几天啊!
下面看一下这个东东啊!也许可以帮上你了啊?
#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_UseAnsi=y                                                                        ;编码
#AutoIt3Wrapper_Icon=                                                                                 ;图标
#AutoIt3Wrapper_OutFile=                                                                        ;输出文件名
#AutoIt3Wrapper_OutFile_Type=exe                                                        ;文件类型
#AutoIt3Wrapper_Compression=4                                                                ;压缩等级
#AutoIt3Wrapper_UseUpx=y                                                                         ;使用压缩
#AutoIt3Wrapper_Res_Comment=                                                                 ;注释
#AutoIt3Wrapper_Res_Description=                                                        ;详细信息
#AutoIt3Wrapper_Res_Fileversion=                                                        ;文件版本
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p                                ;自动更新版本
#AutoIt3Wrapper_Res_LegalCopyright=                                                 ;版权
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer%                ;自定义资源段
;#AutoIt3Wrapper_Run_Tidy=                                                   ;脚本整理
;#AutoIt3Wrapper_Run_Obfuscator=                                                      ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check=                                                                 ;语法检查
;#AutoIt3Wrapper_Run_Before=                                                                 ;运行前
;#AutoIt3Wrapper_Run_After=                                                                        ;运行后
#EndRegion AutoIt3Wrapper 预编译参数设置完成
#cs ____________________________________

AutoIt 版本: 3.2.13.7 (第一版)
脚本作者:技术一良
        Email:wxyyabc@163.com
        QQ/TM:6598181
脚本版本:
脚本功能:

#ce _______________脚本开始_________________
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("终端用户管理器", 495, 409, 228, 156)
$List1 = GUICtrlCreateList("", 0, 56, 489, 136)
GUICtrlSetData(-1, "")
$List2 = GUICtrlCreateList("", 0, 256, 489, 136)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("终端用户", 192, 8, 73, 33, 0)
$Button2 = GUICtrlCreateButton("终端会话", 192, 208, 73, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $run = Run(@ComSpec & " /c query user", '', @SW_HIDE, $STDOUT_CHILD); 查看终端用户
                        ProcessWaitClose($run)
                        $string = StdoutRead($run)
                        $string = StringRegExpReplace($string, '\n', '|', 0)
                        GUICtrlSetData($List1, $string)
                Case $Button2
                        $run = Run(@ComSpec & " /c query session", '', @SW_HIDE, $STDOUT_CHILD); 查看终端会话
                        ProcessWaitClose($run)
                        $string = StdoutRead($run)
                        $string = StringRegExpReplace($string, '\n', '|', 0)
                        GUICtrlSetData($List2, $string)
      EndSwitch
WEnd

wxyyabc 发表于 2010-6-24 21:18:38

研究好久才找到的东东啊!下次请客啊!

ybbihsse 发表于 2010-6-28 11:42:14

不行哈.客户端名没获取到

pusofalse 发表于 2010-6-28 11:50:24

WTSEnumerateProcesses: http://msdn.microsoft.com/en-us/library/aa383831(VS.85).aspx

ybbihsse 发表于 2010-6-28 23:13:07

版本,看不是很懂耶,能说明下吗
页: [1]
查看完整版本: WIN2003任管管理器