windows - How can I get the name directory in a variable- batch programming -


i'm trying use name of directory, can't name in variable. here's current script:

mkdir "d:\documents\testbatch\temp"   set tempdossier="d:\documents\testbatch\temp"   :check   cd /d d:\documents\testbatch   /d %%x in (*_c_* ) (   call :fct_log_texte info  " dossier disponible %%x"   setlocal enabledelayedexpansion    set vardossier= %%x   echo !vardossier!   set rename=!vardossier!   echo %rename%   :: quote variable , remove !   set rename="%rename:!=%"   

i can't understand code if want directory name full path of it, can use call command variable this:

@echo off set fullpath="d:\documents\testbatch\temp temp" call :show %fullpath% pause goto :eof :show echo %~n1 

if run above batch file, print temp temp on screen.no quotes, no !. example. think can modify yourself. hope useful you.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -