Batch file to create a folder?
-
Hi! I'm new to using batch file.. I would like to create a new folder with the name, for example; If the folder "01" already exists and the current date is "01", do not create any folder. If the folder "01" already exists and the current date is "02", create folder "02". Copy everything contained in "01" to "02" after "02" is created. I hope this can be done using the batch file without using any VBS code which I don't have any knowledge.. Thank you.
-
Answer:
@echo off setlocal enabledelayedexpansion cd %~dp0 set currentDate=%date:~7,2% if not exist %CurrentDate% ( md %CurrentDate% set /a lastdate=%CurrentDate%-1 if "!lastDate:~1,1!"=="" set LastDate=0!LastDate! if exist ".\!LastDate!\nul" copy ".\!LastDate!\*.*" ".\%CurrentDate%\*.*" )
caine hammers at Yahoo! Answers Visit the source
Related Q & A:
- How to skip the input in batch file?Best solution by Stack Overflow
- How to run an interactive batch file on windows from a service?Best solution by Stack Overflow
- How to create a virtual file on mac OS X?Best solution by Super User
- How do I create a guest ftp user and give access to specific sub-folder with SSH?Best solution by Server Fault
- How to make a batch file copy itself?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.