Hi All,
I wonder if someone has a tip for how to create a dummy .txt file inside a folder with the file name of the parent folder.
If I have folder with sub-folders I would like to create one file in each folder.
With the command below I get the file created, but it in the same level as the parent folder, not inside the parent folder.
for /d /r %%G in (*) do (type NUL > %%G.txt)
I wonder if someone have any good ideas?
Thanks!
Create a dummy file with the name of the parent folder name
Moderator: DosItHelp
Re: Create a dummy file with the name of the parent folder n
inside is inside
edit: added "nx".
Code: Select all
for /d /r %%G in (*) do (type NUL > "%%~G\%%~nxG.txt")
edit: added "nx".
Last edited by Endoro on 30 Mar 2013 20:41, edited 1 time in total.
Re: Create a dummy file with the name of the parent folder n
missing the modifiers.
Code: Select all
for /d /r %%G in (*) do (type NUL > "%%~G\%%~nxG.txt")
Re: Create a dummy file with the name of the parent folder n
Works perfect!
1000 thanks!
1000 thanks!