Once you've imported your text from the file, your regex pattern might look something like this:
Code:
^(\\\\AN\\ANDFS\\HOMEDIRS[0-9]\\[0-9A-Z]{8})\\Profile$
^ signifies the beginning of a string, and $ signifies the end of it. The parentheses are for capturing a part of the tested string for usage later. The forward slash is a special escape character in regex, so to get a literal one, you need to double them up ("\\\\" is 2 literal forward slashes).

Then you have your path info, where I'm making some assumptions about your data. "HOMEDIRS[0-9]" assumes that this will always look like "HOMEDIRS" followed by a single number, 0-9. "[0-9A-Z]{8}" assumes that this next part will always be a set of 8 alphanumeric, uppercase characters. Finally "Profile" at the end.

So, to use it...
Code:
dim objRegExp
set objRegExp = new RegExp
with objRegExp
  .Pattern = "^(\\\\AN\\ANDFS\\HOMEDIRS[0-9]\\[0-9A-Z]{8})\\Profile$"
  .IgnoreCase = varIgnoreCase
  .Global = True
end with
ereg = objRegExp.replace("\\AN\ANDFS\HOMEDIRS6\E1149536\Profile","$1")
set objRegExp = nothing
msgBox ereg
When ereg displays in msgBox, you should have "\\AN\ANDFS\HOMEDIRS6\E1149536". The $1 in the replace() method is a back reference to the part of the string you captured in the parentheses of your pattern.