House of Fusion
Home of the ColdFusion Community

Search cf-talk

December 02, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

Trying to use cfexecute to run batch file

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Faircloth
09/05/2008 11:59 PM

I'm trying to use cfexecute to run this bath file content: ftp -s:getfiles.txt The batch file reads its commands from "getfiles.txt", which has the following code: open datalink.interealty.com [username] [password] cd /DataLinkOutput/SAV/SAV_1000019201 prompt mget *.* bye I can run the batch file manually and all is well. However, I can't get any results except a timeout when I use <cfexecute> to run the batch file. I've googled and tried everything I can think of, but obviously something's not right. Here's the <cfexecute> code: <cfexecute name="e:\adobe_site\getfiles.bat"            timeout="60"> But that's not working. Suggestions? Thanks, Rick

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Faircloth
09/06/2008 08:22 AM

Trying the cfexecute this way didn't work, either: <cfexecute      name="c:\windows\systems32\cmd.exe"      arguments="/c e:\adobe_site\getfiles.bat"      timeout="30">      </cfexecute> ??? Thanks, Rick ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jim Wright
09/06/2008 11:09 AM

----- Excess quoted text cut - see Original Post for more ----- I'm guessing the context of the cfexecute is some other directory than what you actually want it to be.  Change your directory in your batch file with: cd c:\adobe_site That way it can find the ftp command file.  Alternatively, you can put in the full path to the ftp command file: ftp -s:c:\adobe_site\getfiles.txt and within that command file you could change your the local directory to wherever you want the files dumped: lcd c:\somedirectorywhereiwantthefiles\

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Justin D. Scott
09/06/2008 12:59 PM

> However, I can't get any results except a timeout when I use > <cfexecute> to run the batch file. > > <cfexecute name="e:\adobe_site\getfiles.bat" >            timeout="60"> Based on the file sized that you're likely dealing with, the timeout is too low.  I run my CDEXECUTE with a timeout of 10800 for IDX downloads... <cfsetting requesttimeout="10800" /> <cfexecute name="#expandPath('.\FTPBatch.cmd')#" timeout="10800" /> FTPBatch.cmd is in the same folder as the calling script and has all of the commands needed to get to the proper folder and run the ftp command line: @echo off e: cd \inetpub\wwwroot\mls\imports ftp -n -s:..\FTPScript.txt FTPScript.txt is also in the same folder as the calling script and has the actual FTP commands to execute (connect, user, pass, get, etc.).  In my case the "imports" folder is directly below the folder where all the scripts and such are located. -- Justin Scott, http://www.tlson.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Faircloth
09/06/2008 05:32 PM

Thanks, everyone, for the suggestions. Here's the final solution: cfexecute code: <cfexecute      name="C:\WINDOWS\system32\cmd.exe"      arguments="/c e:\inetpub\webroot\real_estate_data\smlc\daily_downloads\zip_files\getfiles.bat"      timeout="10800"> </cfexecute> batch file: ftp -s:e:\inetpub\webroot\real_estate_data\smlc\daily_downloads\zip_files\getfiles.txt ftp commands file: open datalink.interealty.com anonymous IDX292A prompt cd /DataLinkOutput/SAV/SAV_1000019201 lcd e:\inetpub\webroot\real_estate_data\smlc\daily_downloads\zip_files mget *.* bye Glad that's working!  Got to move forward with this app! @Justin:  I think I'm going to have to get a second account with MLXchange, too. I don't see how the data-handling can be done when I'm just sent incremental data each day, but don't know whether those files are for insertion, deletion, or updating! Rick ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
09/06/2008 12:41 PM

> I'm trying to use cfexecute to run this bath file content: > > ftp -s:getfiles.txt Specify the full path to getfiles.txt. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information!


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists