Note that any option value that contains spaces, like your command value, should be enclosed in double quotes when submitted via the command line (or if submitted via a program, a STAF API called wrapData is provided to "wrap" the data) so that the STAF command parser knows when an option value begins and ends. For example:
STAF local PROCESS START COMMAND "C:/IBM/ITM/BIN/tacmd.exe stopAgent -t NT -f" workdir C:/IBM/ITM/BIN WAIT RETURNSTDOUT STDERRTOSTDOUT The return code 128 is being returned by the command you are running (tacmd.exe), not STAF. The PROCESS service syntax is the same regardless of the operating system. Did you try running the command without STAF on the Windows 2003 machine and see what you get, as maybe you don't have tacmd.exe installed or set up correctly on that machine? One other thing you could try is to specify the SAMECONSOLE option on your PROCESS START request in case the tacmd.exe tries to read from standard input. For example: STAF local PROCESS START COMMAND "C:/IBM/ITM/BIN/tacmd.exe stopAgent -t NT -f" workdir C:/IBM/ITM/BIN WAIT RETURNSTDOUT STDERRTOSTDOUT SAMECONSOLE -------------------------------------------------------------- Sharon Lucas IBM Austin, luc...@us.ibm.com (512) 286-7313 or Tieline 363-7313 Andrea Savelli Sr <savel...@it.ibm.com> 05/27/2009 03:18 AM To Sharon Lucas/Austin/i...@ibmus cc Subject Re: [staf-users] Error starting the process Hi Lucas, thank you very much for your quick help. I have follow your istructions but the result is another error. In particular, I install a ITM OS Agent on two Windows platform. When I run the start and stop command for agent with staf like staf local process start command C:/IBM/ITM/BIN/tacmd.exe stopAgent -t NT -f workdir C:/IBM/ITM/BIN WAIT RETURNSTDOUT STDERRTOSTDOUT on the Windows 2000 Server the result is Response -------- { Return Code: 0 Key : <None> Files : [ { Return Code: 0 Data : KUICKA007I: Stopping NT agent(s). KUICKA015I: All NT agents on the local system were stopped. } ] } instead on Windows 2003 Server the result is Response -------- { Return Code: 128 Key : <None> Files : [ { Return Code: 0 Data : } ] } Do you known if this depends on the platform, or on the setting of machines, or other? Thank you for your help. Bye Andrea Sharon Lucas <luc...@us.ibm.com> 26/05/2009 19.01 To Andrea Savelli Sr/Italy/Contr/i...@ibmit cc staf-users@lists.sourceforge.net Subject Re: [staf-users] Error starting the process 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, luc...@us.ibm.com (512) 286-7313 or Tieline 363-7313 Andrea Savelli Sr <savel...@it.ibm.com> 05/26/2009 11:18 AM To staf-users@lists.sourceforge.net 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 staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users 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 staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users