Batch file that copy itself to folders in current directory? -


the scenario this.

i have batch file in i:\test.bat in drive, there 3 folders. this.

i:\folder1 i:\folder2 i:\folder2\folder3 

assume don't know name of folder1, folder2, , folder3 so, how can make batch file knows folders in current path , copy same name?

i want have this.

i:\folder1\test.bat i:\folder2\test.bat i:\folder2\folder3\test.bat 

how make happen?

try this, @ output , remove echo, if ok:

@echo off cd /d i:\ /r /d %%i in (folder?) echo copy "%~f0" "%%i" 

this expands batch file name full path+file name: %~f0.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -