Append to file in shared folder

Hi I am trying to write to file stored in shared folder. I have mapped the folder to "X:\test.csv"
but i get error.

|[Try: 1] Failed to write line: 3489132849057853600000

I would request the experts to guide me so i can correct it.

Thank you

Possible reasons:

  1. OS file size max breached;
  2. While writing that particular line, the file got accessed by some other source which then denied share rights to your program.

I have checked the logs... and found nothing similar..

If you can help me with the path of network folder in AFL it will help me ...

I tried powershell and append the network file via powershell command, it works properly..

Also do you know how to execute powershell script in AFL..
please guide
thank you in advance for responding


If using fopen, common syntax is:

FilePath = "Root_Drive://Directory0//Directory1//...//file.extension"; // For e.g. "C://Users//Me//MyDesktop//abc.txt"
fh = fopen( FilePath, "a", 1 ); // a for appending
if( fh ) {
   fputs( "Testing", fh );
   fclose( fh );
else {
   printf("Error opening file");

Read ShellExecute. You can also run batch.

To add, for this purpose of yours, there is absolutely no need to run any script. See File Input/Output functions section here - proper usage of those functions must suffice.


is not working


ShellExecute( "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "C:\\powershell\\orders.ps1", "" );
1 Like

Thanks a lot ...Thanks a lot ...Thanks a lot ...