Well, maybe you could do something like what you describe if you have an enterprise level ColdFusion server. With an enterpise licensed ColdFusion server you can have different instances of CF running on a machine. You could configure one instance to use the domain account and the other to not use one. Then have the instance with the domain account for running the <cffile....> operation.
But that really that sounds like a great deal of work and possible expense for very little gain.
Why do you not want to always run CF under the given domain account? If it is a permission issue with somebody worrying about CF having too much privilage. Well just don't give that account an iota more permissions then it needs to do the job. Lock it down to specific file servers or even dirctories on the file server, etc.
That's the way we work it.
So how do you do it?
I have now tried switching CF services over to the domain account (on AD). The file server directories have the user with r/w permissions. When I try to access a file tho, I get access denied.
I tried doing a cf mapping and direct full path to the file server.
We have a domain user for ColdFusion. We call ours "cfappuser".
That user has been given permission on specic sections of our file server.
I access those sections in my CFML with UNC paths like "\\dprhq01\purtem$\incomming_pur_data_files\"
Works slick for us.
SLAP TO THE HEAD!!!!
WHACK HEAD ON MONITOR!!!!
I changed the CF user on the ColdFusion services but NOT on the JRun CF Server. Did that and it works as expected.
SMACK SMACK SMACK SMACK
Is it Friday yet?