Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to follow the PSexec-like route, here is an example (with C++) source, <a href="http://www.codeguru.com/cpp/i-n/network/remoteinvocation/article.php/c5433" rel="nofollow noreferrer">called XCmd</a>.</p> <p>Or you can download the updated XCmd project <a href="http://sourceforge.net/projects/thegrimlinker/" rel="nofollow noreferrer">(now called 'The Grim Linker') from SourceForge.</a></p> <p>Essentially, it extracts a service at run-time, copies it to the remote system, installs it as a service, then connects to it (via named Pipes).</p> <p>The other option is to use WMI's built-in remote execution abilities. Here is an example in VBScript that you could convert to Delphi. The example below executes notepad on the remote system.</p> <pre><code>' This script provides a function for executing a command on a remote computer ' This uses WMI and requires that you have administrative righs on the remote machine ' Dim strComputer, strCommandLineToRun 'change the period to an IP Address or computer name strComputer = "." 'example: strComputer = "192.168.1.105" 'this is the path to the file on the computer whose name/IP address is stored in the strComputer variable strCommandLineToRun = "c:\windows\system32\calc.exe" ' This calls the function to run the process on a remote computer RemoteExecute strComputer,"","",strCommandLineToRun Function RemoteExecute(strServer, strUser, strPassword, CmdLine) Const Impersonate = 3 RemoteExecute = -1 Set Locator = CreateObject("WbemScripting.SWbemLocator") Set Service = Locator.ConnectServer(strServer, "root\cimv2", strUser, strPassword) Service.Security_.ImpersonationLevel = Impersonate Set Process = Service.Get("Win32_Process") result = Process.Create(CmdLine, , , ProcessId) If (result &lt;&gt; 0) Then WScript.Echo "Creating Remote Process Failed: " &amp; result Wscript.Quit End If RemoteExecute = ProcessId End Function </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload