Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Below is 2 scripts I have been trying to merge together.
What I have is a file called tbundy.nsf and I need to rename it based on the file date. I need it to be in the following format: Ted_Bundy.2002-01-03.nsf
The file I am starting with will always be the same name format. (tbundy.nsf)Jdoe.nsf - John DoeThe first script renames it but it treats the filename as one variable. I guess I somehow need to treat the filename as two variables in order to have the filename not end up like this tedbundy.nsf020103
FOR %%V.nsf IN (%1) DO FOR /F "tokens=1-5 delims=/: " %%J IN ("%%~tV") DO copy "%%V.nsf"
"d:\logfiles\log\%%v%%L%%J%%K.nsf" /Y
----------------------
On the second command here is what I enter and I comes back with:D:\logfiles>r1.cmd d:\logfiles tbundy Ted_Bundy
Renaming tbundy.nsf to Ted_Bundy.nsf in d:\logfiles dir and sub-dirs
Ren "d:\logfiles\tbundy.nsf" "Ted_Bundy.nsf"
:Batchfile name r1.cmd
If %1.==. (Echo Folder "%~f1" not found & GoTo :EOF)
If not exist %~f1.\Nul (Echo Folder "%~f1" not found & GoTo :EOF)
ECHO Renaming %2.nsf to %3.nsf in %~f1 dir and sub-dirs
For /R %1 %%I in (%2.nsf) Do (If exist %%~fI Echo Ren "%%~fI" "%3.nsf")::Please note that these command must be run from xp or win2k in order to work.
I just need to be able to enter the filename I am looking (jdoe.nsf) for and the File name I want in return is a file that looks like John_Doe.2001-10-03.nsf
It also needs to search the subdirectories for the file.

![]() |
append footer to printed ...
|
C++ help please
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |