GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Alternate Data Streams not preserved after copy operation from a Network Folder


ADS not copied together with the files/folders if copied from network share. It is preserved if copied from regular folder not a network one.


The type of folder should not matter, as long as the network drive supports ADS (many NAS do not, for example) and the appropriate options are turned on in Preferences / File Operations / Copy Attributes or via Copy-command arguments.

Copy all NTFS data streams should be turned on if you want to copy all ADS.

Which ADS data are you finding is missing? What are the exact steps to see what you are seeing? Which version of Opus are you using, and what kind of OS/machine is the server?


Opus version 12.9, Windows 7 x64, of course the option is turned on in copy attributes.
There was a time and I don't remember which version it was but it was working properly now it doesn't.
The ADS that I have are custom ADS and if I have a folder with custom ADS which resides in a local disk not a network one those ADS's are copied. None of them are copied if they reside in a network folder and copied to the Desktop for example. The network folder is on a Windows 8.1 share.


I created a file in a network share, added a custom ADS value to it, then copied it to my desktop. The copy still had the ADS data.

Can you give us exact steps on how to create the files and ADS streams, and then copy them, to see the same thing you are seeing?



I had this problem with ADS three days ago and I couldn't copy ANY folder from a network location with embedded ADS to my local drive. Then yesterday it works flawlessly and today it again did not work. Today I have tried to debug why it happened but I did not find anything that is different three days ago and yesterday than today. I have explained the steps that I did and I will explain them again:

  1. Create a folder in a network share with custom ADS (not the standard one that windows create when you download file from the internet to block its execution)
  2. Just try to copy the folder by using the copy and paste operation. Sometimes ADS are copied and sometime they are not. Maybe there is some kind of racing problem with Opus after copying the folder it does not copy the ADS afterwards but I sincerely can't point why it happened but it certainly does happened in my case.
    Please note that the problem doesn't seem to happened if you copy from a local drive to a network share it only loses the ADS if you copy the folder from a network share to a local drive.


What is the custom ADS? How do we create it?

Are you always copying to the same destination folder?


I will give you an Autohotkey script that generate ADS. I will give you the EXE file as well as the ahk file.
I don't always copy to the same destination and I also don't copy the same folder. It looks that randomly it is being copied and randomly it is just not being copied together with the folder and I just don't understand why.
I will write for you an Autohotkey and you can use it to tailor it to your use.


And also I don't know how do you scan the folder or the file for its ADS information. There is a Windows API that can scan all the embedded ADS in a file/folder. I will give you also an .ahk script that uses windows API to scan all ADS's in a file/Folder.


Is there an email address that I can send it to you or your colleagues?

Install autohotkey application

Save the below as XXXXXXX.ahk file and double click on the file


fileencoding, UTF-8-RAW

ADSDirectoryPath  := "C:\MyCustomADSFolder"
CustomADSDataName := "CustomADSDataFileName.ADS"
CustomADSContent  := "I am the content of ADS DATA "

filecreatedir, %ADSDirectoryPath%

AddCustomADSData(ADSDirectoryPath, CustomADSDataName, CustomADSContent)

formatTime, TimeString, %A_Now%, dddd MMMM d, yyyy @ HH:mm:ss
AddCustomADSData(ADSDirectoryPath, CustomADSDataName, TimeString)

ADSContent = %ADSDirectoryPath%:%CustomADSDataName%
fileread, ADSContent, %ADSDirectoryPath%:%CustomADSDataName%
msgbox, ADSContentFromFolderName %ADSDirectoryPath%=`n%ADSContent%  

msgbox % GetAllStreams(ADSDirectoryPath)


GetAllStreams(byref FileFolderPath)
  For Index, Stream In EnumFileStreams(FileFolderPath)
;   MsgBox, 0, Stream #%Index%, % "Size: " . Stream.Size . "`nName: " . Stream.Name
    Temp := Stream.Name
    fileread, ADS,%FileFolderPath%%Temp%
    ADSContent = %Temp%`n%ADS%`n`n
    ADSData = %ADSData%%ADSContent%
  return %ADSData%

AddCustomADSData(byref FileFolderPath,byref CustomADSDataName,byref CustomADSContent)
  fileappend, %CustomADSContent%, %FileFolderPath%:%CustomADSDataName%

   ; FileName : The fully qualified file name.
   Streams := []
   If (DllCall("Kernel32.dll\GetVersion", "UChar") < 6)
      Return False
   VarSetCapacity(FSD, 600, 0) ; WIN32_FIND_STREAM_DATA
   HFIND := DllCall("Kernel32.dll\FindFirstStreamW", "WStr", FileName, "Int", 0, "Ptr", &FSD, "UInt", 0, "Ptr")
   If (HFIND <> -1) 
      Streams.Insert({Size: NumGet(&FSD, 0, "UInt64"), Name: StrGet(&FSD + 8, 296, "UTF-16")})
      While DllCall("Kernel32.dll\FindNextStreamW", "Ptr", HFIND, "Ptr", &FSD)
         Streams.Insert({Size: NumGet(&FSD, 0, "UInt64"), Name: StrGet(&FSD + 8, 296, "UTF-16")})
      DllCall("Kernel32.dll\FindClose", "Ptr", HFIND)
      Return Streams
   Return False


Has this issue being investigated?


Please be patient, and please also link your account.


I also sometime backup my network folders which include Alternate Data Streams and Now after seeing this thread I tried copying from a network share to a standard folder and indeed the ADS weren't copied together with the folder. Could you please try to replicate this issue?



Have you checked the configuration options in the first reply?


Yes I have the option to copy all NTFS data streams enabled in preferences. As far as I can recall I initially was checking if ADS is copied long time ago once I enabled this option and they were copied so I never checked it again because I assumed that it will continue copying it. Now I have quite a few problems because most of my folders that were copied from a network share didn't preserve their ADS and I will need to recreate them. Some of the folders indeed preserve the ADS's but most of them didn't.


I now tried experimenting to copy with Windows Explorer and it does not seem to have any problem although I tried just a few folders.



Please note that ADS copying is either ALL or Nothing. It either copy all the data streams or none of them for a folder so it seems that there are folders that you just can't identify ANY of the embedded ADS. Maybe it will help you to debug it further.


I have been trying to use the Autohotkey example and it is discovering all the ADS so maybe you could try to translate the API calls used in this example and try debugging the problem using those API's unless this is how you implement discovering ADS already.


<Am I patient enough? Or I need to wait indefinitely for your response if this issue is being investigated.> At least being an Explorer replacement it should behave regarding ADS the same as Explorer. Neither me nor my colleague can use your program now because it doesn't copy Alternate Data streams and I need to run scripts on those folders using pre configured buttons. I have given you the Autohotkey script and this script "ALWAYS" can identify ADS regardless if it is in a Network share or a standard folder. Those API's are the right ones to check for ADS.


You still haven't linked your account, kanu. This is on our list to try to reproduce, but if you want to speed things up then the first step is linking your account to show you have purchased Opus.