By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!How would I use a batch file command to rename me.txt to
"todaysdate""todaystime"me.txt (exclusive of the quotes)?
ren me.txt "%_isodate %@replace[:,.,%_time] me.txt"
It would depend on your desired format for the date and time, of course. Perhaps something like this would work for you?
Code:ren me.txt "%_isodate %@replace[:,.,%_time] me.txt"
It would depend on your desired format for the date and time, of course. Perhaps something like this would work for you?
Code:ren me.txt "%_isodate %@replace[:,.,%_time] me.txt"
CWBillow wrote:
| ---Quote (Originally by Charles Dye)---
| It would depend on your desired format for the date and time, of
| course. Perhaps something like this would work for you?
|
|
| Code:
| ---------
| ren me.txt "%_isodate %@replace[:,.,%_time] me.txt"
| ---------
| ---End Quote---
|
| Thanks Charles. That'll give me just what I need...and a lesson in
| date/time formatting, I think!
Another alternative is %_datetime; benefit: no embedded spaces in name (but
it leaves it without punctuations).
My own scheme normally uses the file's timestamp:
ren me.txt "%@replace[-,,%@filedate[me.txt,4]]
%@replace[:.,-,%@filetime[me.txt,w,s] me.txt"
When I import photographs, I always use the file's date and time (or - when
available - the date and time the picture was taken, extracted from the EXIF
data). I do use the seconds element of time, since more than one picture can
be taken withing a minute.
--
HTH, Steve
>
> Steve, and what of the "setdos/y1"? Isn't that available in v0?
> 'cause I get an error using it.
>
> Chuck
>
>
>
>
CWBillow wrote:
Another alternative is %_datetime; benefit: no embedded spaces in name (but it leaves it without punctuations).
setdos /y1 is obsolete. You need to use the new BDEBUGGER command.
Don't embed the command within your batch script. If you desire to debug
your batch script then invoke the batch debugger with the script you wish
to debug.
E.g.
BDEBUGGER foo.btm
It is a much more powerful and robust debug environment than single
stepping.
-Scott
CWBillow <> wrote on 06/17/2009 05:12:34 PM:
> CWBillow wrote:
> | ---Quote (Originally by Charles Dye)---
> | It would depend on your desired format for the date and time, of
> | course. Perhaps something like this would work for you?
> |
> |
> | Code:
> | ---------
> | ren me.txt "%_isodate %@replace[:,.,%_time] me.txt"
> | ---------
> | ---End Quote---
> |
> | Thanks Charles. That'll give me just what I need...and a lesson in
> | date/time formatting, I think!
>
> Another alternative is %_datetime; benefit: no embedded spaces in name
> (but
> it leaves it without punctuations).
>
> My own scheme normally uses the file's timestamp:
>
> ren me.txt "%@replace[-,,%@filedate[me.txt,4]]
> %@replace[:.,-,%@filetime[me.txt,w,s] me.txt"
>
> When I import photographs, I always use the file's date and time (or -
> when
> available - the date and time the picture was taken, extracted from the
> EXIF
> data). I do use the seconds element of time, since more than one picture
> can
> be taken withing a minute.
> --
> HTH, Steve
>
>
>
>
>
>From the readme-win.txt file: