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

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -