PsExec下载地址及其用法

PsExec下载地址   PSTools.zip


http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx


Using PsExec

See the July 2004 issue of Windows IT Pro Magazine for Mark's article that covers advanced usage of PsExec.

Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,... ] cmd [arguments]

computerDirect PsExec to run the application on the computer or computers specified. If you omit the computer name PsExec runs the application on the local system and if you enter a computer name of "\\*" PsExec runs the applications on all computers in the current domain.
@fileDirects PsExec to run the command on each computer listed in the text file specified.
-aSeparate processors on which the application can run with commas where 1 is the lowest numbered CPU. For example, to run the application on CPU 2 and CPU 4, enter: "-a 2,4"
-cCopy the specified program to the remote system for execution. If you omit this option then the application must be in the system's path on the remote system.
-dDon't wait for application to terminate. Only use this option for non-interactive applications.
-eDoes not load the specified account's profile.
-fCopy the specified program to the remote system even if the file already exists on the remote system.
-iRun the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.
-lRun process as limited user (strips the Administrators group and allows only privileges assigned to the Users group). On Windows Vista the process runs with Low Integrity.
-nSpecifies timeout in seconds connecting to remote computers.
-pSpecifies optional password for user name. If you omit this you will be prompted to enter a hidden password.
-sRun remote process in the System account.
-uSpecifies optional user name for login to remote computer.
-vCopy the specified file only if it has a higher version number or is newer on than the one on the remote system.
-wSet the working directory of the process (relative to the remote computer).
-xDisplay the UI on the Winlogon desktop (local system only).
-prioritySpecifies -low, -belownormal, -abovenormal, -high or -realtime to run the process at a different priority. Use -background to run at low memory and I/O priority on Vista.
programName of the program to execute.
argumentsArguments to pass (note that file paths must be absolute paths on the target system)

You can enclose applications that have spaces in their name with quotation marks e.g. "psexec \\marklap "c:\long name\app.exe". Input is only passed to the remote system when you press the enter key, and typing Ctrl-C terminates the remote process.

If you omit a username the remote process runs in the same account from which you execute PsExec, but because the remote process is impersonating it will not have access to network resources on the remote system. When you specify a username the remote process executes in the account specified, and will have access to any network resources the account has access to. Note that the password is transmitted in clear text to the remote system.


Examples

This article I wrote describes how PsExec works and gives tips on how to use it:

The following command launches an interactive command prompt on \\marklap:

psexec \\marklap cmd

This command executes IpConfig on the remote system with the /all switch, and displays the resulting output locally:

psexec \\marklap ipconfig /all

This command copies the program test.exe to the remote system and executes it interactively:

psexec \\marklap -c test.exe

Specify the full path to a program that is already installed on a remote system if its not on the system's path:

psexec \\marklap c:\bin\test.exe

Run Regedit interactively in the System account to view the contents of the SAM and SECURITY keys::

psexec -i -d -s c:\windows\regedit.exe

To run Internet Explorer as with limited-user privileges use this command:

psexec -l -d "c:\program files\internet explorer\iexplore.exe"


以下命令可在 \\marklap 上启动交互式命令提示窗口:
psexec \\marklap cmd
此命令通过 /all 开关在远程系统上执行 IpConfig,并在本地显示输出结果:
psexec \\marklap ipconfig /all
此命令将程序 test.exe 复制到远程系统,并以交互方式执行此程序:
psexec \\marklap -c test.exe
如果远程系统中已经安装的程序不在系统路径中,请指定该程序的完整路径:
psexec \\marklap c:\bin\test.exe
在系统帐户中以交互方式运行 Regedit,以便查看 SAM 和 SECURITY  注册表项的内容:
psexec -i -d -s c:\windows\regedit.exe
要以受限用户权限运行 Internet Explorer,请使用此命令:
psexec -l -d "c:\program files\internet explorer\iexplore.exe"


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PsExec用法如下:      1)psexec   usage: psexec \computer [-u username [-p password] [-c [-f] [-i][-d] program [arguments]      psexec是一个远程执行工具,你可以像使用telnet一样使用它。   它的使用格式为:   psexec \远程机器ip [-u username [-p password] [-c [-f] [-i][-d] program [arguments]   它的参数有:   -u后面跟用户名 -p后面是跟密码的,如果建立ipc连接后这两个参数则不需要。(如果没有-p参数,则输入命令后会要求你输入密码)   -c <[路径]文件名>:拷贝文件到远程机器并运行(注意:运行结束后文件会自动删除)   -d不等待程序执行完就返回,(比如要让远程机器运行tftp服务端的时候使用,不然psexec命令会一直等待tftp程序结束才会返回) -i 在远程机器上运行一个名为psexesvc进程,(到底什么用弄不明白) @file 用于针对文本文件中所指定的所有计算机运行该命令(下同)      假设我在远程机器ip有一个账号,账号名是:abc 密码是:123   比如想要用telnet一样在远程系统上执行命令可以打:   psexec \远程机器ip -u abc -p 123 cmd      如果想要远程机器执行本地c:srm.exe文件可以打:   psexec \远程机器ip -u abc -p 123 -c c:srm.exe      如果想要让远程机器执行本地上tftp服务端,(假设tftp服务端在本地c:tftp32.exe),可以打:   psexec \远程机器ip -u abc -p 123 -c c:tftp32.exe -d

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值