Check
http://www.doughennig.com/papers/Pub/Windows7.pdf>Hi everyone,
>
>I have this code in a form that copies files from backup folder/file using Shell.Application. When I run the form in VFP before compiling it into Exe file it does as expected copying the files.But when compiled into an exe file and run in Windows 7 it doesn't work., Same Exe file runs in Windows XP.
>Any idea why it works when run in VFP and not when after its been compiled to an Exe file and run in Windows 7, but works in Window XP?
>
>Any idea would be greatly appreciated
>
>Thanks,
>
>Sonny
>
>
>
>
>LOCAL lcDirPath, lcCurrentDir, oShell, oDstFolder
>Do while .T.
> With ThisForm
> lcCurrentDir = ALLTRIM(SYS(5))+ALLTRIM(SYS(2003))
> lcDirPath = ALLTRIM(.txtDirPath.Value)
> IF EMPTY(.txtDirPath.Value)
> Messagebox("Directory Pathname is Empty",0+16,"Invalid Entry")
> Exit
> ENDIF
> IF .NOT. DIRECTORY(.txtDirPath.Value)
> Messagebox("Directory Pathname Not Found!",0+16,"Invalid Entry")
> Exit
> ENDIF
> SET SAFETY OFF
> oShell = CREATEOBJECT("Shell.Application")
> oDstFolder = oShell.NameSpace("&lcCurrentDir"+"\datafile")
> IF VARTYPE(oDstFolder)="O"
> oDstFolder.CopyHere("&lcDirPath"+"\*.*")
> ENDIF
> SET SAFETY On
> Exit
>Enddo
>
>