Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

TOUCH question

Which of c a w times of a file can TOUCH change?
The help file, if I read correctly, says all three, but I can't get it to work.
I'm using an NTFS-formatted USB drive, I think that's a LFN drive, isn't it?
TCC 9.02.147 Windows XP [Version 5,1.2600]
Code:
C:\temp>del /q /e a & > a & for %i in (a c w) dir /M /K /H /T:%i a
28-09-2008  16:29               0  a
28-09-2008  16:25               0  a
28-09-2008  16:29               0  a

C:\temp>for %i in (a c w) touch /T%[i]17:01 a
28-09-2008 17:01:00,000  C:\temp\a
28-09-2008 17:01:00,000  C:\temp\a
28-09-2008 17:01:00,000  C:\temp\a

C:\temp>for %i in (a c w) dir /M /K /H /T:%i a
28-09-2008  16:29               0  a
28-09-2008  16:25               0  a
28-09-2008  17:01               0  a

According to TOUCH all of a c w times where changed - at least that's how I interpret the output, but according to DIR only w time was changed. What am I doing wrong?
 
On Sun, 28 Sep 2008 16:42:04 -0500, "JP Software Forums"
<[email protected]>,Stefano Piccardi <> wrote:


>for %i in (a c w) touch /T%17:01 a


It works here without [].

v:\> for %i in (a c w) dir /M /K /H /T:%i a
2008-09-28 17:01 0 a
2008-09-28 17:01 0 a
2008-09-28 17:01 0 a

v:\> for %i in (a c w) touch /T%i17:04 a
2008-09-28 17:04:00.000 V:\a
2008-09-28 17:04:00.000 V:\a
2008-09-28 17:04:00.000 V:\a

v:\> for %i in (a c w) dir /M /K /H /T:%i a
2008-09-28 17:04 0 a
2008-09-28 17:04 0 a
2008-09-28 17:04 0 a
 
Stefano Piccardi wrote:

> Which of c a w times of a file can TOUCH change?
> The help file, if I read correctly, says all three, but I can't get it
> to work.
> I'm using an NTFS-formatted USB drive, I think that's a LFN drive, isn't it?
> TCC 9.02.147 Windows XP [Version 5,1.2600]
> Code:
>
> C:\temp>del /q /e a & > a & for %i in (a c w) dir /M /K /H /T:%i a
> 28-09-2008 16:29 0 a
> 28-09-2008 16:25 0 a
> 28-09-2008 16:29 0 a
>
> C:\temp>for %i in (a c w) touch /T%17:01 a
> 28-09-2008 17:01:00,000 C:\temp\a
> 28-09-2008 17:01:00,000 C:\temp\a
> 28-09-2008 17:01:00,000 C:\temp\a
>
> C:\temp>for %i in (a c w) dir /M /K /H /T:%i a
> 28-09-2008 16:29 0 a
> 28-09-2008 16:25 0 a
> 28-09-2008 17:01 0 a
>
> According to TOUCH all of a c w times where changed - at least that's
> how I interpret the output, but according to DIR only w time was
> changed. What am I doing wrong?


You cannot use the % construct for FOR variables. What you're doing
is appending an empty string to /T, so it's defaulting to 'w' each time.

Rex Conn
JP Software
 

Similar threads

Replies
6
Views
3K
Replies
2
Views
2K
Back
Top