# Is there a touch command in XP?

**URL:** <https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232>\
**Category:** Factual Questions\
**Created:** [October 23, 2008, 5:19pm UTC](https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232 "2008-10-23T17:19:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![unspun](https://avatars.discourse-cdn.com/v4/letter/u/b9bd4f/32.png) [@unspun](https://boards.straightdope.com/u/unspun)\
**Post date:** [October 23, 2008, 5:19pm UTC](https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232/1 "2008-10-23T17:19:42Z")

</div>

I need the equivalent of Unix ‘touch’ command to modify file’s modified attributes. Is there any way to do this in XP?

(The reason - I recently brought a USB-stick mp3 player which arranges files and directories according to most recently modified, instead of alphabetically :rolleyes: It makes things rather confusing)

---

<div class="post-metadata">

**Author:** ![robardin](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@robardin](https://boards.straightdope.com/u/robardin)\
**Post date:** [October 23, 2008, 5:32pm UTC](https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232/2 "2008-10-23T17:32:24Z")

</div>

There’s [this freeware set](http://sourceforge.net/projects/unxutils) of UNIX-like command like utilities for Win32. I’ve used a bunch of them myself.

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [October 23, 2008, 6:07pm UTC](https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232/3 "2008-10-23T18:07:30Z")

</div>

If you often find yourself wishing for a Unix shell in Windows, I highly recommend [Cygwin](http://cygwin.com/); most of the standard Unix command-line and console utilities are available, including touch, bash, vi, emacs, gcc, grep, …

---

<div class="post-metadata">

**Author:** ![bouv](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@bouv](https://boards.straightdope.com/u/bouv)\
**Post date:** [October 24, 2008, 4:07am UTC](https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232/4 "2008-10-24T04:07:03Z")

</div>

> [@unspun](#):
>
> (The reason - I recently brought a USB-stick mp3 player which arranges files and directories according to most recently modified, instead of alphabetically :rolleyes: It makes things rather confusing)

I know nothing about ‘touch’ commands and such, but why can 't you just change the folder’s properties to arrange things alphabetically?

---

<div class="post-metadata">

**Author:** ![gazpacho](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@gazpacho](https://boards.straightdope.com/u/gazpacho)\
**Post date:** [October 24, 2008, 4:12am UTC](https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232/5 "2008-10-24T04:12:04Z")

</div>

> [@bouv](#):
>
> I know nothing about ‘touch’ commands and such, but why can 't you just change the folder’s properties to arrange things alphabetically?

Because that just sets how the things are displayed by windows and does not actually change anything on the MP3 player.

---

<div class="post-metadata">

**Author:** ![Number](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/number/32/242_2.png) [@Number](https://boards.straightdope.com/u/Number)\
**Post date:** [October 24, 2008, 4:16am UTC](https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232/6 "2008-10-24T04:16:49Z")

</div>

You can change the date modified using vbscript. There’s an example at the end of [this article](http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar08/hey0326.mspx).

This could be further customized if you were to supply more details about how you’d want it to work. Do you want to run it against one file at a time or all the files in a directory? What do you want to set the dates to?

---

<div class="post-metadata">

**Author:** ![unspun](https://avatars.discourse-cdn.com/v4/letter/u/b9bd4f/32.png) [@unspun](https://boards.straightdope.com/u/unspun)\
**Post date:** [October 24, 2008, 1:02pm UTC](https://boards.straightdope.com/t/is-there-a-touch-command-in-xp/469232/7 "2008-10-24T13:02:57Z")

</div>

Okay, so I downloaded the unixutils and went wild touching files. Then discovered the mp3 player was arranging files according to _created_, not last modified attribute. Felt thwarted, but googled a bit anyway and lo and behold, found an app that can set last modified and date created attributes. Installed it, and was promptly notified by AVG that I had a trojan file. :rolleyes: :mad: Splendid. Pressed ahead and modified files, only to observe the player now displays files with no apparent order at all, it’s just a fucking jumble. AVG seems to have sorted the trojan (and for this reason I will not advertise what program I found), but my conclusion is I’ll just have to live with jumbled mp3s. :o :mad:
