|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Trying to use cfexecute to run batch file
I'm trying to use cfexecute to run this bath file content:Rick Faircloth 09/05/08 11:59 P Trying the cfexecute this way didn't work, either:Rick Faircloth 09/06/08 08:22 A > Trying the cfexecute this way didn't work, either:Jim Wright 09/06/08 11:09 A > However, I can't get any results except a timeout when I useJustin D. Scott 09/06/08 12:59 P Thanks, everyone, for the suggestions.Rick Faircloth 09/06/08 05:32 P > I'm trying to use cfexecute to run this bath file content:Dave Watts 09/06/08 12:41 P 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 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 ----- ----- 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\ > 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/ 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 ----- > 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!
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||