Hi all, I need to process some files then move them to a different location, all this done in batch. It works fine outside of batch, but I cant seems to figure out why it wont run in batch. The file locations are on the server, and I have full access.
public void moveFile()
{
FilePath fpath;
Filename fname;
InteropPermission interopPerm;
FileIOPermission filepermission;
Set permissionSet;
fpath = @'\\Server\Test\test.ord';
fname = @'\\Server\Test\TestArchive\test.ord';
filepermission = new FileIOPermission(fname, 'RW');
interopPerm = new InteropPermission(InteropKind::ClrInterop);
permissionSet = new Set(Types::Class);
permissionSet.add(interopPerm);
permissionSet.add(filepermission);
CodeAccessPermission::assertMultiple(permissionSet);
System.IO.File::Copy(fpath,fname);
CodeAccessPermission::revertAssert();
/*interopPerm = new InteropPermission(InteropKind::ClrInterop);
interopPerm.assert();
System.IO.File::Copy(fpath,fname);*/
}
I've set the RunOn propetrty to calledFrom, client and server, but none seem to have any effect. Any ideas?