239

What do you use when you want to update the date-modified field of a file on Windows?

  1. commands accessible via C++, .NET, C#, or something native to Windows (Vista preferably)
  2. tools/applications preferably free, and if possible open source as well

Edit: there is already a page for applications as pointed out by CheapScotsman here.

If anyone knows how I can do this via C++, C#, WSH or something similar, well and good, else I would think everything else is covered in the linked question.

facepalmd
  • 644
  • 3
  • 10
  • 14
  • http://stackoverflow.com/questions/210201/how-to-create-empty-text-file-from-a-batch-file mentions a load, including `REM.>a` – barlop Jun 17 '15 at 00:30
  • The four alternatives mentioned above, plus four more not mentioned here, can be found in the answer to a similar question: ["Windows Recursive Touch Command"](http://superuser.com/questions/251470/windows-recursive-touch-command/251507#251507 "Windows Recursive Touch Command") – JdeBP Feb 28 '11 at 19:58
  • https://www.npmjs.com/package/touch-for-windows works for me – Piotr Migdal Jan 29 '20 at 19:46

32 Answers32

433

If you want to touch the date stamp of a file using windows, use the following command at the command prompt:

copy /b filename.ext +,,

(where filename.ext is your file's name). The +,, is a special flag to copy telling it to simply update the date/time on the file:

* Changing the time and date of a file

If you want to assign the current time and date to a file without modifying the file, use the following syntax:

copy /b Source+,,

The commas indicate the omission of the Destination parameter.

Edit based on comments by Lumi and Justin: put this in a batch file, eg. touch.cmd

@COPY /B %1+,, %1

This works even if the file is not in the current directory (tested on Windows 7).

  • 4
    This will be slow if the files are large. – mob Sep 18 '09 at 15:09
  • 17
    `type touch.bat` is `@echo off` and next line `copy /b %1 +,,` - put it into `C:\bin` or what have you for your own scripts, and then you can use it like `touch myfile.txt`. – Lumi Jun 13 '11 at 13:37
  • 22
    In Win7 this won't work if you are not in the folder containing the file. It will create a copy in the current working directory. –  Jun 27 '12 at 07:48
  • 1
    @Jamie yes, I also meet this problem. – netawater Jan 11 '13 at 03:22
  • 5
    @mob Note this was not slow on a large file. I used it on a >1GB file on a network drive and it returned immediately (and worked). – Chadwick Jan 23 '13 at 19:51
  • 1
    @Jamie : Not related to Win7, applies to all OS. You need to be in the current directory as ,, will take the very same file with no path information (see technet link from josmh comment) – Mat M Jun 06 '13 at 11:53
  • @Gish Domains: would you like to promote your answer as Community wiki. I think it is very helpful, although not marked as answer. – Mat M Jun 06 '13 at 12:23
  • 3
    I created a [GIST](https://gist.github.com/tjbarbour/6356774) combining this answer with [this one](http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd) to automatically push/pop destination directory – TJB Aug 27 '13 at 17:55
  • 1
    @TJB batch files might consider starting with `@echo OFF` – drzaus Nov 13 '13 at 15:52
  • 8
    If you need to do this in a remote folder (UNC path) - you must specify the destination to the copy command as well - `copy /b Source+,, Source` - where `Source` includes the full path to the file – Justin Dec 13 '13 at 22:37
  • 8
    `+,,`: http://blogs.msdn.com/b/oldnewthing/archive/2013/07/10/10432879.aspx – thirtydot May 08 '14 at 01:33
  • 2
    `This will be slow if the files are large.` Actually, it is not slow, it does it in less than one second, and does not even light up the HD-access LED. Clearly the `copy` command in Windows has the `touch` command specially coded in, per the Technet article. +1 Great find; I never knew this one. – Synetech Sep 15 '15 at 00:48
  • One small tiny little problem: it does copy all the files; it places them into CWD. – Violet Giraffe Aug 31 '17 at 08:46
  • 1
    Windows XP doesn't like copying the file over itself from outside CWD. For this, use `pushd "%~dp1%"` before the CWD "touch", and `popd` afterward. (In case you're stuck supporting one of the millions of remaining XP machines...) – Tydaeus Sep 21 '17 at 19:50
  • This did not work for me at all unless I added additional code to CD to the dir and CD back. Without that, even the copy that is created in the local directory still had the original timestamp despite the +,, flags. I used the powershell 1-liner instead and it worked perfectly – user9399 Feb 18 '19 at 16:12
  • This is not an adequate replacement for the `touch` command, as it doesn't create the file if it doesn't exist. – Gabriel Morin Feb 21 '19 at 17:34
  • this is not as useful - the most important feature, copying the timestamps from file1 to file2 with `touch file2 -r file1`, isn't handled. – Tomas Sep 07 '19 at 13:36
  • Know this is a very old thread but easiest way now with a PowerShell is `New-Item`'s Alias: `ni ` – Lachie White May 04 '20 at 02:51
  • thanks. Clearly a hack by MS, poor quality and poorly documented since "help copy" does not mention it – user1708042 Aug 13 '20 at 13:18
  • why is the /b parameter needed? – Youda008 Feb 06 '21 at 11:56
  • 2
    @Youda008 - `/b` tells `copy` that the file is binary rather than text. Also, [as noted by Raymond Chen](https://devblogs.microsoft.com/oldnewthing/20130710-00/?p=3843), the trailing `,,` at the end of the command is superfluous. – Bill_Stewart Apr 07 '21 at 16:50
  • Doesn’t work on folders. Instead applies to the contents of the folder. – Frungi Sep 24 '22 at 15:07
168

I've used and recommend unxutils which are native Win32 ports of lots of common Unix utilities. There is a touch command in there.

Greg Hewgill
  • 5,499
  • 2
  • 29
  • 30
  • 7
    As almost every unix-to-windows port ever, this fails to work with unicode characters in the filenames outside of the encoding set as the default for non-unicode programs. Test filename that will trip up every such tool: `"test тест τεστ.txt"` – RomanSt Apr 29 '14 at 03:06
  • gnuwin32 has it. but indeed, gnuwin32's also fails for unicode characters. – barlop Jan 23 '16 at 04:37
  • 1
    Update from 2017 In Windows 10 we can use the Linux subsystem for windows, which installs bash. No need for cygwin, MinGW, unxutils or any other partial unix to windows ports. https://docs.microsoft.com/en-us/windows/wsl/install-win10 – Davos Mar 26 '18 at 10:39
  • @Davos have you tried that on any file other than your (usually unprivileged) user context? Because technically the userland side of LXSS is running as unprivileged user. – 0xC0000022L Aug 21 '19 at 10:22
  • @0xC0000022L not sure what you mean in the context of the `touch` command. It's like anything else in nix environments, you can either do it or you can sudo it, or you can't because you don't have privileges. – Davos Aug 21 '19 at 11:13
  • @Davos _**user** context_! Start whatever WSL flavor you have installed. Now I am _assuming_ you have drive C: and it's NTFS (because the `%SystemDrive%` has to be). Inside your WSL shell prompt, execute the following: `touch /mnt/c/Windows/System32` (of course feel free to try that as well with other commands and go right ahead and try it with `sudo`/`su`, too). Everything in WSL (v1) is running as your NT user and has the same privileges, no matter if you use `sudo` or `su` within WSL. It's a sandboxed environment, comparable to unprivileged LXD/LXC containers. Very limiting. You see now? – 0xC0000022L Aug 21 '19 at 12:16
  • 1
    These days it's literally easier to install the code-signed package [Git for Windows](https://github.com/git-for-windows/git/releases) and use the `touch` from there, as in any case you can use it in any (NT) user context, whereas your suggestion limits you entirely to files and folders owned by the user starting the WSP app (or at least those only accessible with the appropriate ACEs set to modify timestamps). The above port should also work for the same reason. Your method with WSL will only work inside the constraints of the WSL sandbox ... – 0xC0000022L Aug 21 '19 at 12:23
  • Sure do that then, the MingGW that comes with git for windows is certainly a decent option. It's arguable that the WSL v1 is doing it _right_ though, I mean what are you doing creating files in `System32` for? The windows OS is supposed to be privileged kernel space and the ability to clobber it with normal user privileges is a bizarre design decision. There are some fundamental differences between FS permissions on linux vs windows which exposes the fact that it's the norm for win users to run as default admins. A clear impedance in reconciling, for example, docker file mounts or in the WSL – Davos Aug 22 '19 at 05:59
  • "Very limiting", depends on what you're up to doesn't it. – Davos Aug 22 '19 at 06:02
109

If all you want is to change the file's last modified date (which was my case):

C:\> powershell  (ls your-file-name-here).LastWriteTime = Get-Date
ThiagoAlves
  • 1,211
  • 1
  • 8
  • 3
  • 12
    PowerShell FTW. I mean, seriously, unix is cool but PS is cooler. – matt Sep 09 '11 at 14:35
  • 1
    You can update the last time write for multiple files / folders as well –  Sep 22 '11 at 01:50
  • 15
    This will work only on one file. For multiple files: ls * | ForEach-Object {$_.LastWriteTime = Get-Date} – Eli Algranti Oct 02 '12 at 04:52
  • 3
    If you want to do it recursively, this works pretty well: gci -recu -inc "*.*" | % { $_.LastWriteTime = Get-Date } – BrainSlugs83 Jan 15 '13 at 01:43
  • Not sure why, but the asterisks aren't showing up in my above comment -- the "." should be double-quote, asterisk, dot, asterisk, double-quote (you know, "star-dot-star".) Anyway, tried to lookup the help to figure out why, but now it's not editable. Darn. – BrainSlugs83 Jan 15 '13 at 01:50
  • 7
    @BrainSlugs83: use backticks ` for code: `gci -recu -inc "*.*" | % { $_.LastWriteTime = Get-Date }` – alldayremix Jun 29 '13 at 00:44
  • 1
    `touch` sets the time to a specific one or "now" if none is given. `.LastWriteTime` is the same, so you can do something like `.LastWriteTime = '12/30/99 23:59'`. @matt: most likely, you're not very familiar with the *nix shell; PS still seems to have a long way to go --e.g., `sed`? `grep`? `vi`? :p EDIT: Why are my Shift+Enter ignored? How to add new lines? – void Mar 21 '14 at 15:08
  • 6
    Unix touch is great for it's simplicity. – Developer Marius Žilėnas Apr 27 '16 at 04:48
  • This worked perfectly. From a batch file, I could use a one-liner if I just surrounded the powershell command with double-quotes: ```powershell "(ls your-file-name-here).LastWriteTime = Get-Date"``` or alternatively to set the date to another file's: ```powershell "(ls your-file-name-here).LastWriteTime = (ls the-other-file-name-here).LastWriteTime"``` – user9399 Feb 18 '19 at 16:13
  • Doesn’t work on folders: `The property 'LastWriteTime' cannot be found on this object.` – Frungi Sep 24 '22 at 15:09
68
type nul >>file & copy file +,,
  • Creates file if it does not exist.
  • Leaves file contents alone.
  • Just uses cmd built-ins.
  • Both last-access and creation times updated.

UPDATE

Gah! This doesn't work on read-only files, whereas touch does. I suggest:

:touch
if not exist "%~1" type nul >>"%~1"& goto :eof
set _ATTRIBUTES=%~a1
if "%~a1"=="%_ATTRIBUTES:r=%" (copy "%~1"+,,) else attrib -r "%~1" & copy "%~1"+,, & attrib +r "%~1"
bobbogo
  • 1,253
  • 10
  • 11
  • It's a pity that copy cannot ignore the +r attribute the way xcopy does. Or, it's a pity that xcopy doesn't support the weird `filename +,,` syntax. – Abel May 06 '12 at 20:05
  • Unfortunately this does not work (at least not in Windows 7). It seems that the command interpreter does not update the timestamp of the destination of a redirection if the file is not actually modified (i.e., there is not data to redirect). – Synetech Sep 15 '15 at 00:57
33

@dash-tom-bang:

Here is Technet's explanation of the mysterious '+' and commas:

copy /b Source+,,

The commas indicate the omission of the Destination parameter.

The copy command supports merging multiple files into a single destination file. Since a blank destination cannot be specified using a space character at the command prompt, two commas can be used to denote that.

And this is Technet's copy command reference: http://technet.microsoft.com/en-us/library/bb490886.aspx

Faredoon
  • 430
  • 4
  • 5
  • 17
    Now that's just messed up syntax. Seriously, *what were they thinking?* Also note the same documentation says "Destination: Required."... I'm amazed. – sth Nov 25 '09 at 13:22
  • 1
    This doesn't seem to even work in Vista... I wonder if they came to their senses? – quillbreaker Dec 08 '09 at 20:53
  • 1
    Works in Windows 7 – Imran Dec 09 '10 at 05:37
  • 5
    It worked for me even without commas: copy file.ext+ So the documentation is as far from actual behaviour as the behaviour is from any reasonable expectations. – Abgan Jul 17 '11 at 11:24
  • 3
    It worked in Windows Server 2008 but only if you are in the folder containing the file – FrinkTheBrave Dec 12 '11 at 14:48
  • So: `copy foo.txt+bar.txt qux.txt` concatenates the two files and writes the result to the third file; `copy foo.txt+bar.txt` - if the destination file is omitted, it writes the result to the first file in the list; `copy foo.txt+,,` - concatenate file with "nothing" (just sets the last modification time), `copy foo.txt` wouldn't work; `/b` parameter means to treat the file as a binary file. I have also verified that running the command on a very large file returns immediately. – Mike Rosoft Feb 24 '20 at 13:13
23

If you feel like coding it yourself, .NET offers the File.SetLastAccessTime, File.SetCreationTime and File.SetLastWriteTime methods.

Fredrik Mörk
  • 455
  • 5
  • 14
21

here is a recursive version using powershell... this will change the last modified time for all files and subdirectories, and files within this directory's subdirectories

ps c:myDir> Get-ChildItem . * -recurse | ForEach-Object{$_.LastWriteTime = get-date}
roger
  • 311
  • 3
  • 4
  • 2
    Less verbose but yet using only standard Powershell shorthands: `ls * -recurse | % { $_.LastWriteTime = Get-Date }` – Jonas Apr 05 '17 at 09:51
20

I tried this to create an empty file in my batch script. You can use this:

ECHO text>file1.txt
Pang
  • 937
  • 1
  • 9
  • 12
pkm
  • 316
  • 2
  • 7
  • 3
    This is BY FAR the best quick method.. I just needed to create a .gitignore file, and Windows 7 keeps complaining "must enter a filename" etc etc. `echo pie>.gitignore` worked a treat - thanks! –  Mar 07 '14 at 04:02
  • 6
    @Alex This is unrelated, but that windows error is because the file starts with a period. There's a strange hack to get around that in Windows Explorer: make the file end with a period too. So type `.gitignore.` and when you press enter Windows removes the trailing period. Crazy, but it works. – Brad Cupit Apr 23 '15 at 15:26
  • 1
    I wish that I could give this enough upvotes that it would catch the big players in popularity. – Jonathan Mee Mar 03 '16 at 16:56
  • 4
    This doesn't create an empty file though, file1.txt has "text" in it. – Joshua Meyers Mar 15 '17 at 22:06
  • 3
    `touch` is not only used for creating empty files, and creating empty files is not the usage that the OP is asking about. The question says "What do you use when you want to update the date-modified field of a file?" This answer does not answer that question. Instead, the question this answer answers is: "how do you create a file containing arbitrary text, wiping out existing content if a file of the same name already exists?" That's very much a misleading and possibly dangerous answer to the original question. – jez Apr 02 '21 at 15:25
16

The GnuWin32 project has Windows ports of the Gnu versions of the Unix command line utilities.

It comes as a number of separate packages and you can install just the commands you need with no other dependencies. For touch you would need the CoreUtils package.

David Webb
  • 11,876
  • 3
  • 43
  • 39
15

cygwin comes with touch. I know you mentioned that you don't want to install a whole framework, but cygwin is quite lightweight, and can be called from dos command window without the whole unix-like command line turned on.

You can also control what tools to install, so you could simply install the touch.exe file, and leave the rest of the framework.

serg10
  • 341
  • 1
  • 3
  • 10
  • 3
    To your point here, all you need to install is the touch.exe and cygwin.dll file in a directory to use the tool. There are no other dependancies relative to using cygwin based tools. – Tall Jeff Sep 09 '08 at 10:58
  • 1
    when I try this (win7x64) I need 4 cygwin dll's in addition to touch.exe: cygiconv-2.dll cygintl-8.dll cygwin1.dll cyggcc_s-1.dll – matt wilkie May 27 '10 at 20:33
14

Here's a simple regfile I wrote to add right-click "touch" in Windows explorer. It'd be easy to script it, too, since it just calls:

cmd.exe /c copy %1+nul %1 /by
Jon Galloway
  • 469
  • 4
  • 14
  • And don't forget `copy nul some_file` to create an empty file (which is what I see `touch` most often used for). – Joey Aug 27 '09 at 06:28
  • Ack! Zip file inaccessible (something about brinkster22.com needing to be the referring site). Jon, can you update this? – Dan7119 Mar 28 '11 at 14:22
  • Works on Win7. Does not work on WinXP: file time remains the same after executing "copy". – Egor Skriptunoff Aug 25 '16 at 19:26
13

Native win32 ports of many unix commands, including touch.

I've used it before and it works well - no installation, no DLLs, etc

Adam Davis
  • 4,395
  • 4
  • 28
  • 30
11

Try this one from CodeProject.

  • No need to install.
  • If you want, you can even modify the source.
Prakash
  • 211
  • 1
  • 3
  • 2
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Yan Sklyarenko Jun 05 '14 at 14:32
9

You could also install Cygwin which gives you Touch as well as a plethora of other *NIX commands.

jamesaharvey
  • 101
  • 3
9

This content can be saved to a reg file. This will add a right click context menu for all files with the "Touch File" ability (tested on Windows 7). Copy all the following lines to reg file. Run the file and approve the question. Right click on any file (or multiple files) - "Touch File" option is now available.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell]

[HKEY_CLASSES_ROOT\*\shell\Touch File]

[HKEY_CLASSES_ROOT\*\shell\Touch File\command]
@="cmd /C copy /b \"%1\" +,,"
5

There are Windows ports of many Unix utilities. Have a look at unxutils or GnuWin32 projects.

VladV
  • 121
  • 2
5

From a similar question on Stack Overflow.

For updating timestamps (ignoring the other functionality of touch), I'd go with:

copy /b filename.ext +,,
Dennis Williamson
  • 106,229
  • 19
  • 167
  • 187
5

in PowerShell try:

ni fileName.txt

NI is an alias of the New-Item cmdlet.

I say Reinstate Monica
  • 25,487
  • 19
  • 95
  • 131
Monfa.red
  • 101
  • 1
  • 3
  • 1
    Welcome to SuperUser. Thanks for posting! Can you add a link to a website that provides more information about the `ni` command, and perhaps describe more what the command does? – hBy2Py Jun 17 '15 at 02:17
  • 1
    The `New-Item` cmdlet can't be used to update the time stamp of an existing file. – I say Reinstate Monica Jun 17 '15 at 02:56
  • While it doesn't update timestamp, it does create a new file, which is what touch does. +1 from me. – MikeMurko Jun 02 '17 at 16:59
  • I usually use touch to create files, but occasionally to update timestamps (to force a remake for example) – RufusVS Jul 29 '21 at 18:47
4

How about codeproject "Touch for Windows": http://www.codeproject.com/KB/applications/touch_win.aspx

edit; Same question as here: https://stackoverflow.com/questions/51435/windows-version-of-the-unix-touch-command/51439

  • Thanks. I missed that in my search which resulted in loads of touch screen phone related stuff. Probably needs a better tag label I guess. – facepalmd Jul 21 '09 at 21:52
4

If you are using git for one or more projects, the mingw based git-bash for Windows has the touch command. I want to thank @greg-hewgill for pointing out to me that 'nix utilities exist for windows, because it was that which put me on the idea to try touch in git-bash.

Superole
  • 1,709
  • 2
  • 15
  • 21
4

from the website:

Funduc Software Touch is a free 'touch' utility that allows you to change the time/date &/or attribute stamps on one or more files. In addition, FS Touch can add/subtract a specified number of seconds from the existing file time. You can specify which file(s) and/or subdirectories to change via 'complex file masks'. The program can be run from interactively or the command line. New to version 7.2 is a command line switch to change file modified time stamp +/- the specified number of seconds.

FS Touch runs on Windows XP, Vista, Windows 7, & Windows 8.

3

I wanted the 'touch' feature of cloning / duplicating the file dates from another file, natively, and be usable from a batch file.

So 'drag and drop' video file on to batch file, FFMPEG runs, then 'Date Created' and 'Date Modified' from the input file gets copied to the output file.

This seemed simple at first until you find batch files are terrible at handling unicode file names, in-line PowerShell messes up with file name symbols, and double escaping them is a nightmare.

My solution was make the 'touch' part a seperate PowerShell script which I called 'CLONE-FILE-DATE.ps1' and it contains:

param
(
  [Parameter(Mandatory=$true)][string]$SourcePath,
  [Parameter(Mandatory=$true)][string]$TargetPath
)

(GI -LiteralPath $TargetPath).CreationTime  = (GI -LiteralPath $SourcePath).CreationTime
(GI -LiteralPath $TargetPath).LastWriteTime = (GI -LiteralPath $SourcePath).LastWriteTime

Then here is example usage within my 'CONVERT.BAT' batch file:

%~dp0\ffmpeg -i "%~1" ACTION "%~1-output.mp4"

CHCP 65001 > nul && PowerShell -ExecutionPolicy ByPass -File "%~dp0\CLONE-FILE-DATE.PS1" "%~1" "%~1-output.mp4"

I think the PowerShell is readable, so will just explain the batch speak:

%~dp0 is the current directory of the batch file.

%~1 is the path of the file dropped onto the batch without quotes.

CHCP 65001 > nul sets characters to UTF-8 and swallows the output.

-ExecutionPolicy ByPass allows you to run PowerShell without needing to modify the global policy, which is there to prevent people accidentally running scripts.

WhoIsRich
  • 464
  • 3
  • 6
2

In powershell:

New-Item .\file.txt -ItemType File

I prefer to write touch file.txt like in linux, so I define this in my powershell profile

function New-File($filename)
{
   New-Item -ItemType File ".\$filename"
}

Set-Alias -Name touch -Value New-File

Note: you can edit your profile by running this command

notepad $PROFILE
Kellen Stuart
  • 558
  • 3
  • 8
  • 18
2

Save the following as touch.bat in your %windir%\system32 folder or add the folder in which it is saved to your PATH environment variable:

@echo off
if %1.==. goto end
if not exist %1 goto end
copy /b %1 +,, > nul
echo %1 touched!
:end

Sample usage:

touch *.cpp
touch somefile.c

Reference: Microsoft KB 69581

Tim Partridge
  • 305
  • 2
  • 9
2

I found a quick way to do it if you have vim installed (not great for big files, will open entire file then close it...)

vim foobar.txt +wq!

The "+" sets argument to run the following commands. "wq!" is "write, quit, force". This will open file, do a save, then close it immediately afterward.

Jason
  • 201
  • 2
  • 5
1

I appreciate this is an old question, I just discovered touch on my Windows 10 system. I downloaded and installed Git from here (I think) and it looks like touch and various other utilities are in the bin folder.

0909EM
  • 119
  • 2
1

Well, if you really want to have the touch command available, you can put this in a batch file called touch.bat and stick it in C:\Windows:

TYPE NUL >>%1

Simple enough.

MD XF
  • 224
  • 1
  • 4
  • 15
  • This method does NOT update the Modified Time on the following platforms: Windows Server 2012 R2, Windows Server 2016, Windows 10 – Nate Sep 27 '19 at 16:13
1

Try

fsutil file createnew new.txt 0

  • 3
    `The FSUTIL utility requires that you have administrative privileges.` -- and it doesn't behave like `touch` for existing files. – Keith Thompson Feb 18 '12 at 01:39
1

The five alternatives mentioned above, plus three more not mentioned here, can be found on SuperUser: "Windows Recursive Touch Command"

JdeBP
  • 26,613
  • 1
  • 72
  • 103
  • 2
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Yan Sklyarenko Jun 05 '14 at 14:32
1

This is slightly unrelated to the original question, but I find this very useful on Windows due to the GUI.

I'm using the TouchPro utility which provides a GUI (builds into explorer shell):

http://www.jddesign.co.uk/products/touchpro/touchpro.htm

rustyx
  • 890
  • 1
  • 10
  • 24
0

Because I needed this also and a number of other things, I've created my own shell extension that does this: AllSorts I've also open-sourced this here

Stijn Sanders
  • 2,426
  • 3
  • 26
  • 25
0

The Unix people fixed the general problem of updating the file date of any file with the touch command. However, for Windows, sometimes a simpler method is possible for special cases.

I need to update the timestamp of an application shortcut in Windows 8.1 in order to make changes to the background color of the Application Tile visible, see this SO question. Rather than implementing one of the clever tools above, I find it easier to edit the comment field of the shortcut. Most people leave this empty, but of course, a useful comment is quickly conceived. And if a comment exists, adding or removing a final period does never harm.

Roland
  • 387
  • 2
  • 14