echo foldername not complete

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
as30026522
Posts: 2
Joined: 23 Apr 2013 08:04

echo foldername not complete

#1 Post by as30026522 » 23 Apr 2013 08:08

I have the foldername is:

Code: Select all

    172.16.121.10  
    192.168.1.5

and I have the command to show foldername in subdirectory:

Code: Select all

    @ECHO OFF
    FOR /R . %%A in (.) do (
     echo %%~nA
    )
    PAUSE


but output is not complete foldername:

Code: Select all

    172.16.121 
    192.168.1


if foldername isn't ipaddress it echo the complete foldername
i want to echo the complete foldername
thanks for your help!

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: echo foldername not complete

#2 Post by foxidrive » 23 Apr 2013 08:10

Use this:

echo %%~nxA

as30026522
Posts: 2
Joined: 23 Apr 2013 08:04

Re: echo foldername not complete

#3 Post by as30026522 » 23 Apr 2013 08:37

oh! thanks very much for your help foxidrive.

Post Reply