This sample shows how use the %SourceFileName% macro to append or prepend text to the original file name of the file received by the file adapter. This sample includes a helper class with three methods to help with string manipulation of the file name.

This uses an Orchestration to set the Received File Name Message Context Property that the SourceFileName Macro uses. 

This sample will work for BizTalk 2004 and BizTalk 2006.

Get more information from the original blog post on this topic:https://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2005/08/01/how-to-prepend-to-the-sourcefilename-in-biztalk-sample.aspx