update time stamp / date modified

E

Eric Brown

I need to change the time stamp (date modified) on several hundred
files. Is there a way I can do this from the command line? I seem to
remember a "touch" program that does this, but that might have been on
Unix.

The reason is, I have a program that imports photos based on date
modified. Someone edited the photos before I got to them, so the
program no longer imports them in the correct order. If I can sort by
file name and perform a function that updates the time stamp
sequentially, then everything will be OK.

Thanks
eric
 
S

Shenan Stanley

Eric said:
I need to change the time stamp (date modified) on several hundred
files. Is there a way I can do this from the command line? I seem to
remember a "touch" program that does this, but that might have been
on Unix.

The reason is, I have a program that imports photos based on date
modified. Someone edited the photos before I got to them, so the
program no longer imports them in the correct order. If I can sort
by file name and perform a function that updates the time stamp
sequentially, then everything will be OK.

One of my favorite small uni-tasker GUIs...
http://www.petges.lu/
 
P

Paul

Eric said:
I need to change the time stamp (date modified) on several hundred
files. Is there a way I can do this from the command line? I seem to
remember a "touch" program that does this, but that might have been on
Unix.

The reason is, I have a program that imports photos based on date
modified. Someone edited the photos before I got to them, so the
program no longer imports them in the correct order. If I can sort by
file name and perform a function that updates the time stamp
sequentially, then everything will be OK.

Thanks
eric

Gnuwin offers stuff ported/compiled for Windows. "Coreutils 5.3.0" has
a version of "touch".

http://sourceforge.net/project/showfiles.php?group_id=23617

There is probably a proper way to install these, but it is
easier to just explain with an example.

Download (or use the link on the Sourceforge page, as the download link
may be dynamically generated).

http://iweb.dl.sourceforge.net/sourceforge/gnuwin32/coreutils-5.3.0-bin.zip
http://iweb.dl.sourceforge.net/sourceforge/gnuwin32/coreutils-5.3.0-dep.zip

Place them in a separate folder, then extract them. The first one, has
a "bin" folder, with "touch.exe" in it. The second one, the dep.zip,
has libiconv2.dll and libintl3.dll and these are DLLs that the
executables depend on. As long as the two DLLs are in the same place
as the executable, they should be picked up.

Now, open a command window. If you cd to the bin with the files, and
then type "touch --help", the program should run. If the DLLs could
not be located, you'll get a Windows dialog asking for the DLL. If
the DLL was loaded properly, then the DOS command window would have
the command syntax for touch. The touch in question is probably
"GNU touch", with whatever features such a touch has.

I've used the MD5sum program from that package, among other things.
There are quite a few Unix utils in there, even a copy of "sort",
presumably with the intention of scripting applications or something.

Somewhere along the way, I also found some utilities like that,
where the DLL was statically linked in, in which case, you
don't have to worry about where the DLLs are.

In a proper setup, the path to the installation is added to your
Windows environment variables. And then, there is no need to go
around dropping touch.exe, libiconv2.dll and libintl3.dll,
into the folder you're working in. But for a quick demo, you
don't have to do anything fancy. Just dump the necessary bits,
into where you're working.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top