Wednesday, September 4, 2013

Running command remotely / registering dlls remotely

To remotely register a dll or to execute any command, you can use the psexec utility which is freely available on the microsoft website at below link.
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Extract the downloaded file and run the below command from command line.



psexec \\counter-9-pc,counter-8-pc -u administrator regsvr32.exe /s c:\windows\system32\MSDBRPTR.DLL

you can use only one computer or multiple the above is using two computers
the below example is for one computer.

psexec \\counter-9-pc -u administrator regsvr32.exe /s c:\windows\system32\MSDBRPTR.DLL


I already copied the dll file to the target machine. you must do it too.

Also you can run the command on mulitple computers by listing the names of the computer in a file and referring the file as:
psexec @computer.txt -u administrator regsvr32.exe /s c:\windows\system32\MSDBRPTR.DLL

1 comment: