Re: Execute a batch file with CFEXECUTE
I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281640 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Execute a batch file with CFEXECUTE but nothing happened
I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281654 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Execute a batch file with CFEXECUTE
I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281660 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Execute a batch file with CFEXECUTE
I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281663 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Execute a batch file with CFEXECUTE
The default configuration of ColdFusion does not have any permissions to network resources outside the server. By default ColdFusion is configured to run under a local system user in the Windows Services panel. If CF needs permissions to resources outside the local server it needs to be given them by assigning access to the resource to the user it is running under, or creating a user with the appropriate permissions and configuring CF to run under that user. ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281666 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Execute a batch file with CFEXECUTE
I haven't done exactly what you are attempting to do, but we move files over to our db server for bulk insert using cffile and UNC paths. So you would use a cffile call with the action move and the destination \\{db ip}\{share}\ The big gotcha (and possibly what's wrong with your current process) is that there has to be matching user accounts on both machines. We run Coldfusion under a named user account (cfusion in our case) and once we set up a cfusion user account with a matching password on the db server it worked like a charm. So the first thing I'd do is to find out what account the CF service is running under, then make sure its a named account and that there is a matching account on the other box. Judah Calvin Trinh wrote: I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281656 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Execute a batch file with CFEXECUTE
You don't need a mapped drive to do this.. Drive mapping is really a convention for the convenience of users. You should... 1) On the server you are copying TO create share ... The share will have a name (let's call him bob). 2) Create a USER on that same server ... Lets say sam with a password of iam 3) Give the USER on that server permissions to the files and folders (acl permissions) and rights to the share (share permissions). 4) On the CF server create the same user (same username/password - sam/iam) 5) change the service permissions of all of the CF services you are using (Cfapplication server, odbc server, search etc) to login using sam/iam... Note, sam will need to have permissions on the web server to run as a service. You can give sam local admin rights if you like - but there are some implications to that. Suffice it to say that, while same can have very restrictive permissions on the DB server, he must have some expanded permissions on the web server because he's going to be doing more than just copying files. He needs access to the cf files and other services on that machine. 6) Once you have your services logging in as your new user you can copy your file using a UNC path as in\\db_servername\sharename\somefile.txt. It's not as complicated as it sounds :) -Mark -Original Message- From: Calvin Trinh [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 20, 2007 11:09 AM To: CF-Talk Subject: Re: Execute a batch file with CFEXECUTE I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281674 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Execute a batch file with CFEXECUTE
Of course... You can use domain accounts for this as well... Making sure the share is permissioned for a group or user on the domain and then running the cf server on that domain account. -Original Message- From: Calvin Trinh [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 20, 2007 11:09 AM To: CF-Talk Subject: Re: Execute a batch file with CFEXECUTE I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281676 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Execute a batch file with CFEXECUTE
Make sure the user context that CF is running under has permissions. It may not have a mapped drive when it executes the script, but that can be part of the script, or you might be able use a UNC name. -Original Message- From: Calvin Trinh [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 20, 2007 12:10 PM To: CF-Talk Subject: Re: Execute a batch file with CFEXECUTE I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281669 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Execute a batch file with CFEXECUTE but nothing happened
I'm able to execute the batch file now but nothing happen. It seems like Coldfusion server doesn't allow me to map a shared drive on another server. What I want to do is to copy a file on the coldfusion server to my database server. I created a batch file to map the shared drive on my DB server and copy the file over to my DB server. Unfortunately, that didn't happen the way I intended to be. So, I just want to ask is it coldfusion not allowing to map a drive in the code or am I missing something. This is driving me insane. Thanks for the reply. You should be able to reference UNC paths in your batch file, in lieu of mapped drives. Assuming you are running ColdFusion on a Windows server, and that the account that the ColdFusion service is running under has been granted priveledges on the remote server, it should work fine without mapping a drive. ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281684 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Execute a batch file with CFEXECUTE
That's kind of strange - I haven't had any problems doing this. In fact, I made a shortcut function to run batch files for me: cffunction name=executeBatchCommands output=true access=public returntype=void cfargument name=batchCommands type=string required=true hint=Pipe-delimited or line-broken commands for a batch file to execute / cfset var batchFile = expandPath(createUUID() .bat) / cfset var fileContents = listChangeDelims(arguments.batchCommands, chr(13) chr(10), |) / !--- write the batch file to disk --- cffile action=WRITE file=#batchFile# output=#fileContents#/ !--- trace for debugging --- cftrace text=Batch File: #fileContents# !--- execute batch file --- cfexecute name=#batchFile# timeout=999 / !--- remove the batch file --- cffile action=DELETE file=#batchFile#/ /cffunction #executeBatchCommands(del *.php|del *.asp|del *.aspx)# This is on a CF7 server, Windows 2003, is there something magical I don't know about? -- nathan strutz http://www.dopefly.com/ On 6/12/07, Ben Forta [EMAIL PROTECTED] wrote: Run cmd.exe and pass the batch file to it, see http://www.forta.com/blog/index.cfm/2006/7/31/Using-CFEXECUTE-To-Execute-Com mand-Line-Utilities. --- Ben -Original Message- From: Calvin Trinh [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 1:30 PM To: CF-Talk Subject: Execute a batch file with CFEXECUTE Hello, Is it possible to use CFEXECUTE to excute a batch file? I'm trying to use the CFEXECUTE to execute a batch file i created to copy a file from one location to another. It does not work when I use CFEXECUTE to run batch file. Any assistance will be helpful. thanks Here is my code. cfexecute name=D:\CreditRpt.bat/cfexecute Here is my batch file net use z: \\112.5.6.40\d$ /user:admin pass4u copy D:\cme\cmecredits.txt z:\tmp net use z: /delete ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281067 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Execute a batch file with CFEXECUTE
Hello, Is it possible to use CFEXECUTE to excute a batch file? I'm trying to use the CFEXECUTE to execute a batch file i created to copy a file from one location to another. It does not work when I use CFEXECUTE to run batch file. Any assistance will be helpful. thanks Here is my code. cfexecute name=D:\CreditRpt.bat/cfexecute Here is my batch file net use z: \\112.5.6.40\d$ /user:admin pass4u copy D:\cme\cmecredits.txt z:\tmp net use z: /delete ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280824 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Execute a batch file with CFEXECUTE
Run cmd.exe and pass the batch file to it, see http://www.forta.com/blog/index.cfm/2006/7/31/Using-CFEXECUTE-To-Execute-Com mand-Line-Utilities. --- Ben -Original Message- From: Calvin Trinh [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 1:30 PM To: CF-Talk Subject: Execute a batch file with CFEXECUTE Hello, Is it possible to use CFEXECUTE to excute a batch file? I'm trying to use the CFEXECUTE to execute a batch file i created to copy a file from one location to another. It does not work when I use CFEXECUTE to run batch file. Any assistance will be helpful. thanks Here is my code. cfexecute name=D:\CreditRpt.bat/cfexecute Here is my batch file net use z: \\112.5.6.40\d$ /user:admin pass4u copy D:\cme\cmecredits.txt z:\tmp net use z: /delete ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280827 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4