As you're in the UNIX Scripting forum, here an unix syntax:
path1='H:\Smartscan\Canada\35A\Set_DE\'
echo "$path1" | awk -F\\ '{print $(NF-1)}'
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244