1.

Solve : displaying folder name?

Answer» HI - I NEED to find out the folder name of the folder I am in and its parent and save them to a variable. I then need to use the names as aprt of the parameter for stating a program.
The structure is like

ClientName
System
Code: [Select]ECHO.%~dpnx0

FOR %%a in ("%CD%") DO SET CurrentFolder=%%~na
ECHO.Current folder: %CurrentFolder%

CD ..
FOR %%a in ("%CD%") DO SET ParentFolder=%%~na
ECHO.Parent folder: %ParentFolder%

Pause &EXIT
Result of this script:
Code: [Select]C:\Documents and Settings\users\Bureau\ess.CMd
Current folder: Bureau
Parent folder: users
Appuyez sur une touche pour continuer...


Discussion

No Comment Found