>This is my code. I get File Access Denied on Rename line.
>
>Public gnLODModels, myFileList2, dtt2, dtt3, myNewNameb
>Dime myNewNameb(1)
>
>dtt3 = 0
>Dime gnLODModels(1)
>lftdn2 = AllT(ThisForm.Text5.Value)
>Set Default To "\\Gv-engineering\drawing\wgen\prerel\"
>dtt2 = ADir(gnLODModels,lftdn2 + '*.*')
>Set Default to "\\gvmain\applications\foxapps\drawingPDM"
>dtt3 = Int(ALen(gnLODModels)/5)
>
>Set Default To "D:\Plotfile\in\"
>Delete File *.*
>
>For x = 1 To dtt3
> Dime myNewNameb(1)
> dfrt = AllT(ChrTran(gnLODModels(x,1)," ",""))
> dfrt = SubStr(dfrt,1, Len(dfrt)-4)
> Set Safety Off
>STRTOFILE('Request;' + 'PLOTTER=' + '"sample postscript plotter";' + 'NEWPLOT=' + '"\\gv-engineering\drawing\wgen\prerel\' + gnLODModels(x,1) + '";' + 'COPIES= 1;',"C:\Temp\tempjan.bat")
> Set Default to "C:\Temp"
> Run /N2 D:\ccdraft\bin\ccplot.exe -rk tempjan.bat
>
> Set Default To "D:\Plotfile\in\"
> DO WHILE ADIR(myNewNameb) < 1
> ENDDO
>
> Rename myNewNameb(1,1) + "." To &dfrt + "."
> Copy File &dfrt To \\gvmain\groups\everyone\viewfiles\in\&dfrt
> Delete File &dfrt
> Release myNewNameb
> Set Safety On
> Set Default to "\\gvmain\applications\foxapps\drawingPDM"
>Next x
While the lines
DO WHILE ADIR(myNewNameb) < 1
ENDDO
Will help insure that the file has been created, the batch program may not have closed this file yet, and therefore you won't have access to it. You will need to check if the file is available first, possibly with FOPEN(). Take a look at FOPEN() in the help file, it returns -1 if it can't open the file.
John