Delphi Pages Forums

Delphi Pages Forums (
-   General (
-   -   Command Line not working from Delphi service (

rmt 05-01-2019 03:23 PM

Command Line not working from Delphi service
Dear Expert,

Need very urgent solution.

I am trying to run following commandline from delphi XE3 SERVICE but its not working. However, it is working as desired from other delphi5 application. Please suggest.

ExecuteResult := ShellExecute(0, 'open',pchar('aws.exe'), pchar(' s3 cp "c:\test2.csv" s3://myerofirstbucket/'), nil, SW_SHOWNORMAL);


Norrit 05-02-2019 07:20 AM

Delphi service has probably no interaction with the userinterface allowed.
Play with the SW_SHOWNORMAL, I guess it would be SW_HIDE (or whatever the equivilant is, no Delphi running at the moment)

Or perhaps it's as easy as that the service doesn't have permissions to write to c:\ or any other parts. I'm not familiar with aws, so don't know what rights are required.
But you can overcome rights by testing it with setting the service run as administrator user under services.msc

If that still doesn't work, try to log the "SysErrorMessage(GetLastError())" somewhere (windows event log idealy because of user permissions)

rmt 05-02-2019 11:14 AM

1 Attachment(s)
Dear Norrit,

Thanks for reply.

I logged the message as below:

HTML Code:

ExecuteResult := ShellExecute(0, 'open',pchar('aws.exe'), pchar(' s3 ls s3://myerofirstbucket/'), nil,sw_normal );

Attached is the event viewer log. Please suggest how shall i proceed.


Norrit 05-03-2019 09:30 AM

My eyes are probably not what they used to be, can you copy/paste the output instead of screenshot?

All times are GMT. The time now is 11:06 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.