TOUCH question

May 31, 2008
382
2
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?
 
May 20, 2008
11,400
99
Syracuse, NY, USA
On Sun, 28 Sep 2008 16:42:04 -0500, "JP Software Forums"
<neil@jpsoft.com>,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
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
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
Thread starter Title Forum Replies Date
Dick Johnson Question about the Touch command Support 0
wadeb question about touch /s Support 2
vefatica Error message from TOUCH Support 2
Dick Johnson Touch command is off by 1 hour Support 10
fpefpe Documentation touch and /r Support 1
fpefpe Documentation touch Support 6
fpefpe touch - date format Support 2
C Touch command — I Need to touch matching files in another directory. Support 5
Frank Abel Cancio Bello How to? specified milliseconds with the touch command? Support 0
fpefpe Documentation Touch Support 2
nickles WAD touch with reference file Support 5
vefatica WAD TOUCH /R[acw]? Support 8
JohnQSmith Help file for TOUCH Support 0
MikeBaas TOUCH (V13.04.55) Support 3
J touch Support 3
H touch sensitive to order of options Support 2
C touch /c one;two creates only two Support 3
E TOUCH and DST Support 3
Stefano Piccardi TOUCH a directory? Support 3
C forum Posting Question... Support 3
C question re: Move Support 3
S How to? Upgrade Question: What supporting documentation is required at time of purchase? Support 2
Peter Murschall Documentation Question to %@PSHELL Support 4
Fross Tab Question Support 6
Fross Quick Function Question Support 17
rps Documentation "Copy+Paste+run" question Support 2
vefatica SFTP question Support 17
vefatica Question about IPWorks Support 0
C How to? SHORTCUT question..... Support 6
vefatica TPIPE, crash and question Support 1
C Question / Suggestion Support 1
MickeyF Another TPIPE question Support 6
vefatica Another @EVERYTHING question Support 4
mikea How to? %@everything[] question Support 10
A License Question for Single User Support 5
Jay Sage Help Correction (and Related Question) Support 0
S Elapsed time in TCC prompt question Support 0
H command line parsing question Support 5
C Forum question Support 2
B Newbie here, I have a question. Support 4
J Dumb Question ... Support 4
Timothy Byrd Updating from TC 9 to TC 17 - TCTOOLBAR question Support 2
M A possibly stupid question about the "del" command... Support 7
M A just out of curiosity question re @DiskTotal Support 4
Fross Status Bar Time Question Support 1
A Stupid, obvious question - launch a BAT with TC Support 10
C How to? GLOBAL question Support 5
vefatica OT: VisualStudio question Support 1
vefatica Wildcard question Support 4
Dan Glynhampton v15 installer question Support 2

Similar threads