How to Create a file in "my documents" folder?

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

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

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.