I try to be as sort as possible.
I try to do some code in batch and cmd.exe (running Windows). Nwo I try the basic: I try to echo subdirectories listed in a folder.
Code: Select all
for /r %%x in (.\www.slv.dk\Dokumenter\dsweb\Get) do echo "%%x\"
This should list the directories in Get folder. I know there is a bug, because I got this list of files as output:
Code: Select all
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/
C:/program files/GnuWin32/bin/www.slv.dk/./www.slv.dk/Dokumenter/dsweb/Get/
C:/program files/GnuWin32/bin/www.slv.dk/Dokumenter/./www.slv.dk/Dokumenter/dsweb/Get/
Once again:
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/
C:/program files/GnuWin32/bin/www.slv.dk/./www.slv.dk/Dokumenter/dsweb/Get/
C:/program files/GnuWin32/bin/www.slv.dk/Dokumenter/./www.slv.dk/Dokumenter/dsweb/Get/
The marked text is incorrect / non-existing path.
It means there is added "./www.slv.dk/Dokumenter/dsweb/Get/" on end of %%x variable.
But I don't understand why there is listed:
C:/program files/GnuWin32/bin/www.slv.dk/
and
C:/program files/GnuWin32/bin/www.slv.dk/Dokumenter/
instead of the /Get directory???
I would expect something like this:
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/Document-900
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/Document-901
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/Document-902
etc
Is there any simple solution how to make the for echo correct folders? The echo command is just 1st step; I would change it later to this command
Code: Select all
rename %%x\BG_AD_3_BG*.pdf _*.pdf