• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 821
  • Last Modified:

Running commands on a remote computer.

Hi,

Is there any command line tool availbale that can be used to run commands on a remote computer other than PSEXEC tool from Mark.

Thanks!
0
Nirmal Sharma
Asked:
Nirmal Sharma
3 Solutions
 
NacMacFeegleCommented:
There is the remote.exe command from Microsoft
http://technet2.microsoft.com/WindowsServer/en/Library/0926da81-f03a-4986-959d-827b6753c22f1033.mspx
part of the Windows tools but its a potential security hole so you should be VERY careful before implementing it.
Also a 3rd party utility BeyondExec
http://www.beyondlogic.org/consulting/remoteprocess/BeyondExec.htm
same caveats apply.
~
0
 
Darwinian999Commented:
You can also use SSH (Secure SHell) for Windows to securely run commands on remote computers.

Open Source SSH Server & Client for Windows: http://sshwindows.sourceforge.net/
Open Source SSH Client for Windows: http://www.chiark.greenend.org.uk/~sgtatham/putty/
0
 
Nirmal SharmaSolution ArchitectAuthor Commented:
Thanks guys.

I will let you know shortly.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Nirmal SharmaSolution ArchitectAuthor Commented:
Guys, its time to talk about this thread now.

Does this command work for anyone using Beyondexec.exe?

I have renamed Beyondexecv2.exe to bexe.exe

bexe.exe \\remote_computer reg.exe query "HKLM\Software\Microsoft\Updates\Windows Server 2003\SP1\"

The above command (reg.exe query) should list all the sub-keys under SP1 key but using Bexe.exe it doesn work. If I use the same account using PSEXEC.exe and it works fine.

I want to make it work with Bexe.exe (Beyond EXEc). Can this be done and why it doesn't work with BeyondEXEc and same command works with PSEXEC?

Thanks!
0
 
Nirmal SharmaSolution ArchitectAuthor Commented:
one more thing...if don't have a space in Key Name everything works fine!!!
0
 
Darwinian999Commented:
Sounds like a bug in Beyond EXEc - it's not parsing the command line correctly and treating parameters encapsulated in quotes as a single parameter. Try doubling or tripling the quotes. ie:

bexe.exe \\remote_computer reg.exe query ""HKLM\Software\Microsoft\Updates\Windows Server 2003\SP1\""

bexe.exe \\remote_computer reg.exe query """HKLM\Software\Microsoft\Updates\Windows Server 2003\SP1\"""



0
 
Nirmal SharmaSolution ArchitectAuthor Commented:
Yes, it is.

Okay. How can you capture the error message supplied by the external command REG.exe. This command returns :

"Error: The specified registry key or value not found in registry"

I use file redirector (>) to capture the message but it captures only results supplied and if error, it simply shows the error message on command prompt.
0
 
Darwinian999Commented:
Put " 2>&1" at the end of the line (after the redirection, and without the quotes).

Eg echo hello > file.txt 2>&1
0
 
Nirmal SharmaSolution ArchitectAuthor Commented:
Okay...can anyone run the below command let me know the results:

reg.exe query HKLM\Software\Microsoft\Updates\Windows Server 2003\SP1

or

reg.exe query "HKLM\Software\Microsoft\Updates\Windows Server 2003\SP1"

It says : Invalid Key name !

But the above key do exist in Registry.

I'm surprised if this bug is in reg.exe


0
 
Darwinian999Commented:
That key doesn't exist on the system that I just tested, but a test on another key with a space in it works -

reg.exe query "HKLM\Software\Microsoft\Internet Explorer\Explorer Bars"

Running the command without the quotes fails with "ERROR: Invalid syntax"
0
 
Nirmal SharmaSolution ArchitectAuthor Commented:
REG.exe was corrupted.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now