Batch Dos. Fonction pour récuperer le nom du fichier dans un path?

Batch Dos. Fonction pour récuperer le nom du fichier dans un path? - Shell/Batch - Programmation

Marsh Posté le 07-04-2006 à 12:27:40    

bonjour,
 
J'ai un programme Batch DOS (mon_prog.bat)
avec le code suivant
 
Echo off
@for %%X in (E:\Projet\Export\sortielad\*.zlotok) do (
echo %%X
)
 
 
sur mon écran j'ai la sortie suivante:
Echo off
E:\Projet\Export\sortielad\LA0001.zlotok
E:\Projet\Export\sortielad\LA0002.zlotok
 
 
 
C'est très bien mais j'aimerai avoir juste le nom du fichier comme ceci:
Echo off
LA0001.zlotok
LA0002.zlotok
 
 
Est-ce possible?
 
 
Merci d'avance  :bounce:

Reply

Marsh Posté le 07-04-2006 à 12:27:40   

Reply

Marsh Posté le 07-04-2006 à 12:28:56    

echo %%~nxx

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed