What happened to me every day - I had to work
moving files
Moderator: DosItHelp
Re: moving files
Re: moving files
five lines
it seems i still have a lot to learn.
it seems i still have a lot to learn.
-
- Posts: 17
- Joined: 12 Feb 2017 05:11
Re: moving files
HI
yes steffen is king of the trade so far as me a non programmer he has given me lots of solutions
without hesitating if you r a programmer there's lot more to learn from him
iam one of his fan
yes steffen is king of the trade so far as me a non programmer he has given me lots of solutions
without hesitating if you r a programmer there's lot more to learn from him
iam one of his fan
Re: moving files
Too much guys, I become stuck-up
Speaking of learning: If there's something you don't understand in my code then please ask.
Steffen
Speaking of learning: If there's something you don't understand in my code then please ask.
Steffen
Re: moving files
aGerman wrote: ↑05 Apr 2018 09:48SteffenCode: Select all
@echo off &setlocal DisableDelayedExpansion for %%i in (*.*) do if "%%~i" neq "%~nx0" for /f "tokens=* delims=." %%j in ("%%~xi") do ( if not exist "%%j\" md "%%j" move "%%~i" "%%j\" )
Code: Select all
for /f "tokens=* delims=." %%j in ("%%~xi")
Re: moving files
You don't need google to find out how a certain command works. Just execute COMMAND /? (FOR /? in that case).
To answer your question - the ~x is a modifier to expand the FOR variable to the file extension only. "tokens=* delims=." removes the leading dot. Finally the extension without the dot is assigned to %%j.
Steffen
To answer your question - the ~x is a modifier to expand the FOR variable to the file extension only. "tokens=* delims=." removes the leading dot. Finally the extension without the dot is assigned to %%j.
Steffen
Re: moving files
ohh... now it all makes sense, htnks for explanation