How to get correct network folder path in batch?

Hi All,

How to get correct network folder path when code runs in batch jobs?

I have a class which runs in batch job to read text files from network folder & imports data in AX 2012 & move file to another folder.

During moving file to destination folder, system is not taking correct path & error log comes as "System.UnauthorizedAccessException: Access to the path is denied."

like: 

Source path : \\JCBiztalk\Testing_From\ABC.txt

Destination path : \\JCBiztalk\Testing_To\ABC.txt

when batch job runs & tries to move file, FilePath variable takes path as : \\\\JCBiztalk\\Testing_from\\ABC.txt. (with extra slashes).

I need the same path as Source path & destination path when moving file using System.IO.File::Move(_fromLocation,_toLocation).

Also,

I am able to get correct path in directoryInfo using System.IO.DirectoryInfo(_fromLocation), but unable to convert directoryInfo to string to get full path to move file !!

Kindly help me in this.

Regards,

Arun Khanna

Parents Reply Children
No Data
Related
Recommended