You need to either:
a) Fully qualify the path to your command executable so that the command
can be located and successfully started. For example, if your command is
"myTest.exe" and it's located in C:\tests", you can specify:
STAF local PROCESS START COMMAND C:/tests/myTest.exe WORKDIR C:/tests WAIT
RETURNSTDOUT STDERRTOSTDOUT
b) Or, if you wanted your command to run in an environment where the
system path included the working directory, you can use the ENV option to
update the system path environment variable. Note that if you specify the
SHELL option in the PROCESS START request in this situation, you don't
need to specify the path to the command because the updated system path
will be used to find the command. For example:
STAF local PROCESS START SHELL COMMAND myTest.exe ENV
PATH=C:/tests{STAF/Config/Sep/Path}{STAF/Env/Path} WORKDIR C:/tests WAIT
RETURNSTDOUT STDERRTOSTDOUT
Note that in both cases, the WORKDIR option is only needed if your
executable needs to be run in a particular directory.
For more information, see the following example in section "8.12.2 START",
sub-section "Examples", in the STAF User's Guide:
Goal: Start the myTest.exe executable on machine client1.
Syntax and Results:
C:\>STAF client1 PROCESS START COMMAND myTest.exe
Response
--------
60
The result buffer contains the handle number of the process that was
started (which in this case is 60). This is not the return code of the
process as the process was started asynchronously (without the WAIT
option) so the STAF request completes as soon as the process is started
and doesn't wait for the process to complete.
However, if the myTest.exe file was not found in the system path on
machine client1, you would get an error starting the process. For example:
C:\>STAF client1 PROCESS START COMMAND myTest.exe
Error submitting request, RC: 10
Additional info
---------------
Error starting the process. CreateProcess failed with OS RC 2: The system
cannot
find the file specified.
The return code from the STAF request is 10. STAF RC 10 indicates a base
operating system error was encountered (e.g. STAF local HELP ERROR 10
gives more information about STAF RC 10) and an error message that
includes the actual base operating system error code, 2, is provided in
the result buffer. OS error code 2 indicates that a file was not found. In
this case, the myTest.exe file was not found since it's not in the system
path.
If myTest.exe is located in directory C:\tests on machine client1, you can
fully qualify the path to myTest.exe so that the command can be located
and successfully started. For example:
C:\>STAF client1 PROCESS START COMMAND C:/tests/myTest.exe
Response
--------
62
Or, if you wanted myTest.exe to run in an environment where the system
path included the C:/tests directory, you can use the ENV option to update
the system path environment variable. Note that if you specify the SHELL
option in this situation, you don't need to specify the path to the
command because the updated system path will be used to find the command.
For example:
C:\>STAF client1 PROCESS START SHELL COMMAND myTest.exe ENV
PATH=C:/tests{STAF/Config/Sep/Path}{STAF/Env/Path}
Response
--------
64
--------------------------------------------------------------
Sharon Lucas
IBM Austin, [email protected]
(512) 286-7313 or Tieline 363-7313
Andrea Savelli Sr <[email protected]>
05/26/2009 11:18 AM
To
[email protected]
cc
Subject
[staf-users] Error starting the process
Hi,
I would run a command with STAF on Windows platform. So, I launch
staf local process start command <COMMAND> workdir <PATH THAT INCLUDE THE
COMMAND> WAIT RETURNSTDOUT STDERRTOSTDOUT
but the result is following
Error submitting request, RC: 10
Additional info
---------------
Error starting the process. CreateProcess failed with OS RC 2: The system
cannot
find the file specified.
However, when I run the command without STAF, the command is good.
Help me please.
Thank you
Andrea
IBM Italia S.p.A.
Sede Legale: Circonvallazione Idroscalo - 20090 Segrate (MI)
Cap. Soc. euro 400.001.359
C. F. e Reg. Imprese MI 01442240030 - Partita IVA 10914660153
Società soggetta all?attività di direzione e coordinamento di
International Business Machines Corporation
(Salvo che sia diversamente indicato sopra / Unless stated otherwise
above)
IBM Italia S.p.A.
Sede Legale: Circonvallazione Idroscalo - 20090 Segrate (MI)
Cap. Soc. euro 400.001.359
C. F. e Reg. Imprese MI 01442240030 - Partita IVA 10914660153
Società soggetta all?attività di direzione e coordinamento di
International Business Machines Corporation
(Salvo che sia diversamente indicato sopra / Unless stated otherwise
above)
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals.
Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like
Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users