Saved Bookmarks
| 1. |
Solve : rename directory with date? |
|
Answer» If I want to rename a directory name that changes every week, how can I do that? I have tried just about every combination of masks and wildcards I can think of. It has got to be a lot easier than I am making it. If I want to rename a directory name that changes every week, how can I do that? I have tried just about every combination of masks and wildcards I can think of. It has got to be a lot easier than I am making it. This doesn't work for you: ren ??07 show I just tried it, and it WORKS for me. What version of 'dos' are you using? Also tried move *07 show and that worked too. If you need to get that date into an environment variable, so you can specify the exact DIR name - you can do that with a free utility program, Fdate. See: http://www.ferg.org/fdate If you are using WinXP, you can get the date into an environment variable without Fdate, but since I don't use XP I won't attempt to explain that - you can probably find it explained here in these forums though. It comes up every now and then. Fdate is well documented. Along with plenty of examples. It does a LOT more than just get the date too. If you get the hang of it, you find it is a very handy tool to have. And the price is right. I hope this helps. Hi, Thanks for the response. The problem with the ren and "?" filemask is that the composition of the date structure changes. It could be a single digit month or a double digit. Additionally, the ren command did not work for me. I did find the "move" command. It works perfectly, although I had to run two of them in the batchfile to accomodate for the additional character in the date (like 12-07-07). It works now. Quote
As far as ren not working - you forgot to answer the question about which version of "dos" you are using. Honestly, I was surprised it worked here. Using Win98SE. Only reason I tried it was because you mentioned it. In my mind, the way to rename directories was with the move command. That could be something left over from many years ago with plain old MS-DOS - - not sure now. Quote I did find the "move" command. It works perfectly, although I had to run two of them in the batchfile to accomodate for the additional character in the date (like 12-07-07). Sounds like you are using the ? , not the * . The question mark is for one character, the asterisk is for all characters. Quote It works now. And this is the bottom line. Glad you got it going - one way or another. Thanks for posting back. I think your dating yourself, as I am. I miss my C:> prompt. It was so cold and impersonal. * God Bless Bill Gates* As for the DOS version, sorry. It is whatever comes with XP Home. I tried it numerous times with the filemask variables. I could only do it when I specifically used the complete directory name. Anyway, as you stated, it works. Could be the reason I was kicked out of my Pascal and Cobol classes. I am not, and do not ever want to be, a programmer. Quick and dirty is my theory. I flunked one class project - it was some simple manipulation of database problem. It took me over 300 lines of code to do it. The answer was only 30 lines. But mine worked too and it had color graphic responses. (I love the IF THEN ELSE statement.) Thanks again.Quote I think your dating yourself, as I am. I miss my C:> prompt. It was so cold and impersonal. Yes, I probably am dating myself. But that C: prompt worked! without a lot of complicated extraneous stuff. Quote * God Bless Bill Gates* Stay away from www.linuxquestions.org forums with that. Quote As for the DOS version, sorry. It is whatever comes with XP Home. I don't have XP, so based on what you say and what I just tried on Win98, there must be something different about how their respective command interpreters handle it. Quote Anyway, as you stated, it works. Could be the reason I was kicked out of my Pascal and Cobol classes. I am not, and do not ever want to be, a programmer. Quick and dirty is my theory. Get yourself a copy of Fdate. The first time through, it might take you a few minutes to configure. It has a LOT of options is all. But after that, you might find yourself like me - I keep it (and a few other handy programs) in a 'utils' directory in my path. Quote I flunked one class project - it was some simple manipulation of database problem. It took me over 300 lines of code to do it. The answer was only 30 lines. np. Glad you got it. And I hope that you don't have to run it twice now, if you've tried using the asterisk with move , instead of question marks. Sorry Sir, Another question If I want to rename a file name to today's date ex: ren show "today's date" How can I use the command. tks. Quote
For your future benefit, KNOW that it is best to start a new thread with your question. That way it gets NOTICED, and your question gets the attention it deserves. It is also less confusing as others come along and read the current thread. Since your question is easy to answer, here you go: 1.) It can be done, using the command line, under WinXP. I don't have WinXP, so don't feel comfortable trying to talk you through it. You can search the forums here, as it has come up before, and you will likely find the answer. 2.) The way I do it works under not only WindowsXP, but older versions of MS-DOS, and the 'dos' that comes with older versions of Windows. Go here: http://www.ferg.org/fdate/index.html and download a free utility program. It does a LOT more too. To answer your SPECIFIC question, go here: http://www.ferg.org/fdate/index.html#faqs The first example given in that FAQ is exactly your question, answered. I hope that helps. |
|