Originally posted by notepad at 2007-4-30 01:01 PM:
It doesn't work啊 `````
What does it mean???
知,不觉多。不知,乃求知
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Originally posted by notepad at 2007-4-30 01:01 PM:
It doesn't work啊 `````
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
set "fdname=%%i"
call :GetFdName "%fdname%"
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)
Originally posted by zhoushijay at 2007-4-30 04:57 PM:
@echo off
for /f "delims=" %%i in ("c:\aa\bb\cc") do (
echo %%~nxi
)
pause
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
set "fdname=%%i"
call :GetFdName %fdname%
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)
I modified it. I want it to display the current directory folder name. Why can't fdname be passed to getfdname? If I directly pass %%i, when there are spaces in the file, it won't display completely. So I want to set fdname to pass to getfdname.
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
call :GetFdName %%i
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)