What is the simplest way to get a path and return the 2nd subdirectory name?
For instance, my path would be as follows:
Code: Select all
C:\Automation_Batch\APP_1\Hyperion_Batch\Scripts\NTScripts
I essentially need to grab APP_1
I never know what the name of that directory will be, therefore the need to make it dynamic. It will ALWAYS be 2 down from the ROOT. The script performing this action will always be in the NTScripts folder in the same directory.
Thanks!