Code to copy file from one place to another
Set permissionSet;
FileName fileName = "C:\\Import\\FROM SMART VISTA\\a.txt";
FileName fileNameMoved = "C:\\Import\\MOVED INTO AX\\a.txt";
permissionSet = new Set(Types::Class);
permissionSet.add(new InteropPermission(InteropKind::ClrInterop));
permissionSet.add(new FileIOPermission(fileName , 'RWD'));
permissionSet.add(new FileRepository());
CodeAccessPermission::assertMultiple(permissionSet);
WinAPIServer::copyFile(fileName,fileNameMoved,true);
CodeAccessPermission::revertAssert();