No announcement yet.

Execute a command on a remote machine

  • Filter
  • Time
  • Show
Clear All
new posts

  • Execute a command on a remote machine

    I am trying to execute delprof.exe on a remote machine. So far I have the following Custom Tool to do this

    psexec \\%E% cmd.exe "%SystemRoot%\delprof.exe /q /i"

    The only thing that happens though is that it runs a remote Command window. I can type the Delprof.exe command in at the prompt and it will run the process on the remote machine (just like I want) However...I want the delprof.exe command to be passed to the cmd prompt automatically without having to type it in each time. This process would also help in doing multiple machines at once (if possible)

  • #2
    Re: Execute a command on a remote machine

    Try searching all of the forums for psexec to see if anyone has posted something that might help, or ask sysinternals to see if they have any ideas. This sounds reasonable, but you might have to run a batch file instead from Hyena instead of having it all on one line. In other words, first run psexec, then try running the command, but I'm not an expert on this tool.

    If delprof.exe is non-interactive, and your remote clients are using Windows 2000/XP, you might be able to use the Create Process method of WMI to do this, as it does not require any agent (WMI is the agent).

    Hyena v6.0 beta can run the WMI Create Process method on multiple selected computers.
    Kevin Stanush
    SystemTools Software Inc.


    • #3
      Re: Execute a command on a remote machine

      Hears a command line that seems to work. The delprof.exe must be on the remote machine in the %SystemRoot% or %SystemRoot%\System32 directory.

      cmd /c cls & psexec \\%E%cmd /k "delprof.exe /q /i"

      Thanks for your help.

      I will post again when I find a way to copy the delprof.exe file to the correct dir before I run the cmd.


      • #4
        Re: Execute a command on a remote machine

        Here's a separate tool I created to copy the delprof.exe file out to the machine before I run the actual delprof tool.

        cmd /k xcopy /H /Y %SystemRoot%\Delprof.exe \\%E%\Admin$

        I have had sucess selecting multiple machines at once and running the tool. Just say no to the prompt and it will open multiple windows (one for each machine) this way you can see when the file copy is complete and close the window.

        The same is true for the delprof command above. You can delprof multiple machines at once.

        Hope this helps someone. If so, be sure to post here.


        • #5
          Re: Execute a command on a remote machine

          Why not <div class="ubbcode-block"><div class="ubbcode-header">Quote:</div><div class="ubbcode-body"><div class="ubbcode-block"><div class="ubbcode-header">Code:</div><div class="ubbcode-body ubbcode-pre" ><pre>delprof /C:%E% .........</pre></div></div></div></div> ?

          [This message has been edited by Jens Kalski (edited 06-06-2004).]


          • #6
            Re: Execute a command on a remote machine

            This is good and I have used this way to delprof a computer for some time now. However the way I have scripted it here makes the entire delprof process run on the remote system and therefore does not impact your own pc. This frees up system resources on your own pc do do other things. The caviat to this is the remote system must have delprof on it. I solved this with the copy tool.

            PSExec can be helpful for many things. If you have good solutions for PSExec and it's use please post here or on a new thread.