Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<cfexecute>

Status
Not open for further replies.

danarashad

Programmer
Nov 2, 2006
115
0
0
US
I trying to use cfexecute to do a batch copy of files, from one folder to another.


<cfexecute name="D:\copy2.bat" timeout="60"></cfexecute>
the copy2.bat files has a variable in it.
copy D:\folder1\folder2\userdir\#empID#\*.pdf D:\
the #empID# is a variable, i do a cfset before the cfexecute.
This is the error i get
C:\CFusionMX7\runtime\bin>copy
D:\folder1\folder2\userdir\#empID#\*.pdf D:\
The system cannot find the path specified. how do i read the variable #empID#
1793 is what the variable should be. i cant hard code it because it will change.
thanks
 
Pass it in as a parameter. I don't know the exact DOS syntax, but something like this

<cfexecute name="d:\copy2.bat"
arguments="123"
outputfile="d:\copy2Results.out" />

copy2.bat:
copy D:\folder1\%1%\*.pdf F:\



 
i got it working, but i am trying to copy from my server to another. i have the address. the batch file runs, but it doesnt copy. how do i send arguements to login. or is this impossible.
 
I assume you have permissions to copy to this other server. Did you test it manually first (ie not using CF) to make sure the BAT file works?

Did you check the "outfile" for errors? What type of login / credentials? CF usually runs under the system account. It may not have sufficient permissions to perform the action.

 
Can yoy Map a drive to the target drive on the server where the batch file is?

That way you can use the "login in as" parameter in the mapping dialog.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top