Solved

how do i add date to my folder name/

Posted on 2007-03-24
3
422 Views
Last Modified: 2012-06-27
I have this batch from expert here.
I would liek to add the date on the end of each of these folders, but it is not working for me.
please tell me the problem in my script?

setlocal enabledelayedexpansion
for %%a in (data processing audit percentages finalized) do call :process %%a
goto :eof

:process
set /p myDir=Enter the %1 folder name:
md "%mydir%_%date%"
set mydir=
0
Comment
Question by:sher19
  • 3
3 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18787009
Hi sher19, you need to grab the month/day/year?  
Use this...(if echo %date% returns the 'day' for you...)

setlocal enabledelayedexpansion
for %%a in (data processing audit percentages finalized) do call :process %%a
goto :eof

:process
set /p myDir=Enter the %1 folder name:
md "%mydir%_%date:~4,2% %date:~7,2% %date:~10%"
set mydir=
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18787011
Oops, actually, use this...I had some spaces in there...

setlocal enabledelayedexpansion
for %%a in (data processing audit percentages finalized) do call :process %%a
goto :eof

:process
set /p myDir=Enter the %1 folder name:
md "%mydir%_%date:~4,2%%date:~7,2%%date:~10%"
set mydir=

0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18787018
Happy to help - thanx for the grade! :^)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now