How to run dos command as a task in HPC? RRS feed

  • Question

  • I am trying to run a vbs script from within HPC as a task.  I know you can't do this directly (as far as I know) so I am trying to use psexec tool to so so.  If I open a regular command prompt and type in my line of code using psexec the script will run.  However, when I try to run this same command line in HPC as a task I get the error that psexec is not recognized as an internal or external command.

    How can I run a traditional DOS command that includes psexec in it as a task?

    Tuesday, November 27, 2012 3:52 PM

All replies

  • psexec is not a part of Windows, so you have to make sure the psexec.exe is on the Compute Node which is allocated for the task.

    Tuesday, November 27, 2012 9:39 PM
  • Ok, yes, I did that.  I put a copy on the root of each of the servers, but it still won't run.
    Tuesday, November 27, 2012 9:51 PM
  • You need to set PATH in order to run psexec.exe.For example copy psexec.exe to C:\Windows\system32 and add this path to PATH variable (setx PATH C:\Windows\system32 ) or run C\Windows\system32\psexec.exe.

    And you need to install psexec before you can use it.Copying it only is not enough.

    If psexec is still not visible by your tasks try to add '/env:PATH=C:\Windows\system32' to 'job submit' command

    Daniel Drypczewski

    Friday, November 30, 2012 2:13 AM
  • Forgot to mention last time that I copied the file over to the root of each server, and to the root of my machine where I will be submitting the jobs.  After I copied the file I double clicked on it from within each machine so that it would set itself up upon first use.

    I then tried to run the command and it wouldn't fire up.

    I read your post above about adding the  '/env:PATH=C:\Windows\system32' to the job submit command, but I have two problems with that:

    1. I'm not sure how to include this in the command I'm sending.

    2. Don't think I need to set the path since I have the file on the root of each server, and the C drive should already be in the path.
    Tuesday, December 4, 2012 3:21 PM