Link to home
Start Free TrialLog in
Avatar of Rojin Terrance
Rojin Terrance

asked on

Timeout error when executing the command run.cmd using cfexecute tag in ColdFusion programmatically

Here is our ColdFusion code for executing run.cmd programmatically:
<cfexecute timeout=1000
name = "C:\Windows\System32\cmd.exe"
arguments = "C:\ProgramData\ABBYY\SDK\12\""FineReader Engine""\Samples\Java\Hello\run.cmd"
outputFile = "C:\Temp\output.txt" >
</cfexecute>

Error Message:
The requested action did not complete in a timely manner. Timeout period expired without completion of C:\Windows\System32\cmd.exe.

When trying directly from command line, I still get the errors.

So in the command line, I entered up to the last folder cd C:\ProgramData\ABBYY\SDK\12\'FineReader Engine'\Samples\Java\Hello and run 'run.cmd' separately . So it runs correctly without any error.

So, how do I do the same in Coldfusion program ?
Avatar of gdemaria
gdemaria
Flag of United States of America image

I don't know a lot about this, but just throwing out an idea, just in case...   CFEXECUTE likely runs under the same user as the Coldfusion application.   Does that user have access to the commands you are executing?   That user may very well be different from the user you are logged in as when you are testing it on the server.     If this is windows, check the services list for Coldfusion Application and see what user it is running under.
Edit: Fixed backslashes

Since you're using cmd.exe, try adding a "/C" to the beginning of arguments.  The "/C" tells cmd.exe to exit when finished running the command.

Change this line:

     
arguments = "C:\ProgramData\ABBYY\SDK\12\""FineReader Engine""\Samples\Java\Hello\run.cmd"

Open in new window


To this:

           
arguments = '/C "C:\ProgramData\ABBYY\SDK\12\FineReader Engine\Samples\Java\Hello\run.cmd" '

Open in new window

The "/C" tells cmd.exe to exit when finished running the command.

Otherwise, cmd.exe keeps running and never returns. That's why you're getting a timeout ...
When trying directly from command line, I still get the errors..

One other thing.  It's possible the command MUST be executed from a specific directory.  Try wrapping the whole path in quotes (not in the middle), and run it from the command line:

                c:\users\your_username >  "C:\ProgramData\ABBYY\SDK\12\FineReader Engine\Samples\Java\Hello\run.cmd"

If that doesn't work, then yes - you'll have to use a BAT file - as mentioned on your other thread.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.