Windows .bat create folders then delete .bat file

by Max-Enrik   Last Updated June 23, 2018 16:01 PM

How can I write command line for creates many folders then that .bat file will delete automatically, please?

Answers 2

Why would you do something like that? If you only use the command for creating the folders once, you could just do it via cmd.

you could determine bat file location with %0 and delete it- but it's not wise to delete a script were the reason to write it is to use it multiple times…

June 23, 2018 15:29 PM

After creating all folders execute "DEL %~f0" at end of batch file. %~f0 will expand to full path of current batch file. This will delete batch file after execution.

June 23, 2018 15:38 PM

Related Questions

Execute .bat script as administrator from gpedit.msc

Updated October 28, 2017 12:01 PM

Copying and renaming of .xlsm files using batch

Updated September 30, 2018 09:01 AM