cancel
Showing results for 
Search instead for 
Did you mean: 

unable to execute a executable

Former Member
0 Kudos

Hi,

I am trying to execute a third party encrypton program on an application server.I have craeted a OS script to execute the encryption in a series of steps.When I execute this script(compress.cmd) from OS level directly I goes well successfully.However when I created an external commmand in SM69 and try to execute the same script it throws an error message"External program terminated with exit code 128".I am not able to proceed .Please help.

Regards,

Max

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

sounds like a Windows environment.

try run your script and then check the return code:

compress.cmd

echo %errorlevel%

see what is the result. if it shows you 128, it means the script returns a none 0 code it's just NT command prompt ignores it.

If it returns 0, it indicate that your script may rely on some environment settings that exist in your command prompt window but not active when called by SM69. Try use full path names, and no variables in your script (or a temp script) to see if that works.

Former Member
0 Kudos

Hi Alan,

echo %errorlevel% returns a 0 when I execute the command directly from OS level using sidadm user.The only problem is executing thr sm49/sm69

Max

0 Kudos

Then as I said previously, it is very posible that this is a environment variable thing.

there are a couple of things you can try:

1) check dev_* files see if there are any error related to this once you run the script in SM69;

2) try generate some verbose output (i.e. echo "compressing now" >> C:\temp\compress.log ) and redirect them to a flat file. and see if the log file is created and what's in it (so you know at which step it failed).

3) as previously suggested, try use full path and not use evnvironment variables.

Former Member
0 Kudos

Hi Alan,

I am able to execute other os commands in the script when run thru sm69.the only place it stops is the compression step which goes fine when run tru OS level.Also there is no log created for compression.Any suggestions?

Max

0 Kudos

It depends on what compress tool you are using. Itself may rely on some variable to work (i.e. LIB directory, etc).

try modify your script to add "2> C:\temp\compress.log" (no space between 2 and >).

This will redirect all error messages from the compress command to the log file. after you run it in SM69, check the log file content.

Former Member
0 Kudos

Hi Alan,

No log generated even after adding the step.the sample step for compression is as follows.

cd C:\TDA\TDClient

C:\TD\TDClnt\compress F:\temp\t45i-test.dat F:\temp\.enc SECUREONLY SECFILE=head.txt ASCII CRLF DELIMIT=80

Max

0 Kudos

when you updated your script does the line look like below? (the 2> compress.log is at the end of the compress line, not on it's own new line?)

C:\TD\TDClnt\compress F:\temp\t45i-test.dat F:\temp\.enc SECUREONLY SECFILE=head.txt ASCII CRLF DELIMIT=80 2> C:\temp\compress.log

Former Member
0 Kudos

Well yes same script.No log created.

0 Kudos

But if you take this exact line out of your scirpt, it works in SM69?

Former Member
0 Kudos

Well the step does not execute with/without this additional line

0 Kudos

Well, now I'm a little bit confused I though the script works if it does not do compress. Anyways, please clarify for me if possible.

1) is there any other script (your custom scripts, not standard SAP delivered) works in SM69?

2) does this compress.cmd script works without the line that does the compression (let's say remove the C:\TD...compress.... line altogether).

3) if you add "echo script started > c:\temp\compress.log" and run the script from SM69, do you see the c:\temp\compress.log file contain words "script started"?

4) is there any other program named "compress" in your PATH? if you rename your script to comptest.cmd does it run?

Former Member
0 Kudos

Yes "echo script started > c:\temp\compress.log" works from SM59

0 Kudos

Good! that rules out lots of potential issues.

SM69 works, your script name is also not a problem.

It is very likely the problem exists somewhere in the script (I'm still thinking it may because of something like a missing environment variable).

if your script is not too long, try add "echo step 1 completed with rc %errorlevel% >> c:\temp\compress.log" after each real statement.

of course replace the "step 1" with "step 2", "step 3", etc to represent each step of the script.

Then call the script in SM69. See what is the last step it run in the script. You will then know which step of your script is the one causing you grief.