Move File using X++


Is there any sample code to move files from one folder to another folder on the server side? I need the code running in the server side batch job.


I would create a new method in WinAPIServer class, very similar to WinAPIServer::copyFile(). You just have to call System.IO.File::Move() instead of System.IO.File::Copy() and assign right permissions.

Hi Martin,

I want to move file in fttp folder.

Actually I am generating BACS file format for vend payment. And in dialog I want to save the generated file in FTTP location.

Is it possible using X++???

You can use .NET class FtpWebRequest in X++ via .NET Interop.