博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
命令行管理远程windows.(Remote Command Line On Windows)
阅读量:6816 次
发布时间:2019-06-26

本文共 5757 字,大约阅读时间需要 19 分钟。

可以做到在本机连接到远程windows启用命令行的效果。无需在远程windows安装任何客户端

方法如下:

  1. Download PsTools.zip .
  2. Extract to a folder on your hard drive. If you can put them in the path, like in C:\Windows\System32, even better.
  3. Open a Command Prompt: Start > Run > cmd.exe
  4. Change to the directory you extracted the files to: cd c:\pstools, for example.
  5. Enter the command psexec \\RemoteComputer cmd.exe. Replace RemoteComputer with the name of the computer you want to take control of. You have to have admin rights on the remote computer.
  6. A Sysinternals EULA might pop up. Accept it.
  7. Watch as a new command prompt appears in your console window. You’re now controlling the remote computer!

 

PsExec v1.98

By Mark Russinovich

Published: April 28, 2009

(1.60 MB)

Rate:

Share this content

Introduction

Utilities like Telnet and remote control programs like Symantec's PC Anywhere let you execute programs on remote systems, but they can be a pain to set up and require that you install client software on the remote systems that you wish to access. PsExec is a light-weight telnet-replacement that lets you execute processes on other systems, complete with full interactivity for console applications, without having to manually install client software. PsExec's most powerful uses include launching interactive command-prompts on remote systems and remote-enabling tools like IpConfig that otherwise do not have the ability to show information about remote systems.

Note: some anti-virus scanners report that one or more of the tools are infected with a "remote admin" virus. None of the PsTools contain viruses, but they have been used by viruses, which is why they trigger virus notifications.

Installation

Just copy PsExec onto your executable path. Typing "psexec" displays its usage syntax.

Using PsExec

See the July 2004 issue of Windows IT Pro Magazine for 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]

computer

Direct 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.

@file

Directs PsExec to run the command on each computer listed in the text file specified.

-a

Separate 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"

-c

Copy 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.

-d

Don't wait for application to terminate. Only use this option for non-interactive applications.

-e

Does not load the specified account's profile.

-f

Copy the specified program to the remote system even if the file already exists on the remote system.

-i

Run 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.

-l

Run 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.

-n

Specifies timeout in seconds connecting to remote computers.

-p

Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.

-s

Run remote process in the System account.

-u

Specifies optional user name for login to remote computer.

-v

Copy the specified file only if it has a higher version number or is newer on than the one on the remote system.

-w

Set the working directory of the process (relative to the remote computer).

-x

Display the UI on the Winlogon desktop (local system only).

-priority

Specifies -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.

program

Name of the program to execute.

arguments

Arguments 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 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"

(1.60 MB)

转载地址:http://bcbzl.baihongyu.com/

你可能感兴趣的文章
Hibernate 中upate,savaOrUpdate,merge的区别
查看>>
使用ELK构建分布式日志分析系统
查看>>
PHP遍历指定目录,并存储目录内所有文件属性信息
查看>>
VMware+centos7克隆多个虚拟机
查看>>
iOS第三方分享-ShareSDK
查看>>
[CodeForces954G]Castle Defense(二分答案+差分)
查看>>
webpack 配置多页面应用的一次尝试
查看>>
7 逻辑回归
查看>>
java里的基本知识
查看>>
行走在前端路上的一些想法
查看>>
hdu 5288 ZCC loves straight flush
查看>>
前端爬虫cheerio&&puppeteer
查看>>
Linux日常操作整理
查看>>
rem和em的用法
查看>>
【译】整理->20个让你效率更高的CSS代码技巧
查看>>
Prometheus学习系列(十一)之Hello World
查看>>
IDEA常用设置及推荐插件
查看>>
java多线程基本概述(十一)——ReadWriteLock
查看>>
机器学习 深度学习 计算机视觉 资料汇总
查看>>
深度学习网络结构中超参数momentum了解
查看>>