For a while now I’ve been curious if there was a way on Windows to get a remote command line from another computer. You know, just a plain old command prompt, that when you entered commands they ran on a remote computer instead of your own. This is a staple on Linux systems, since they are all based on the command line, but with GUI-based Windows it was proving trickier to do.
I had found some halfway solutions that never seemed to work right, and I wasn’t too happy with any of them. But today I think I finally found the answer I was looking for. It does depend on a free little software download, but aside from that there’s no installation or setup required on either computer.
I first read about it on this site. What you do is go to a certain MS TechNet page and download the PSTools package (linked in the right sidebar). This software is from Sysinternals, a development group that was acquired by Microsoft a couple of years ago. So it’s “official” MS software, much like the PowerToys.
Anyway, here are the instructions for use:
And PsExec is just one of 12 tools in the PsTools package. The rest of them are probably just as useful.
I had found some halfway solutions that never seemed to work right, and I wasn’t too happy with any of them. But today I think I finally found the answer I was looking for. It does depend on a free little software download, but aside from that there’s no installation or setup required on either computer.
I first read about it on this site. What you do is go to a certain MS TechNet page and download the PSTools package (linked in the right sidebar). This software is from Sysinternals, a development group that was acquired by Microsoft a couple of years ago. So it’s “official” MS software, much like the PowerToys.
Anyway, here are the instructions for use:
- Download PsTools.zip from this site.
- Extract to a folder on your hard drive. If you can put them in the path, like in C:\Windows\System32, even better.
- Open a Command Prompt: Start > Run > cmd.exe
- Change to the directory you extracted the files to:
cd c:\pstools
, for example. - 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. - A Sysinternals EULA might pop up. Accept it.
- Watch as a new command prompt appears in your console window. You’re now controlling the remote computer!
And PsExec is just one of 12 tools in the PsTools package. The rest of them are probably just as useful.
範例:
c:\>psexec \\140.137.215.118 -u bar -p 1234 cmd.exe
C:\>shutdown /s
c:\>psexec \\140.137.215.118 -u bar -p 1234 cmd.exe
C:\>shutdown /s
沒有留言:
張貼留言