

The timestamps can be displayed using the following command: PS C:\> Get-Item file. And if you dont believe me - heres a screenshot from my Windows 7 work PC, running X11 with dwm. But you can run X, with a different desktop, as a Windows application, in Windows. If you’re running Windows, you are limited to the Windows desktop environment. PS C:\> (Get-Item " file.txt").LastAccessTime=("20 April 2020 17:00:00") AFAIK - it’s not possible to replace the windows desktop at all. To set the specific timestamps, execute: PS C:\> (Get-Item " file.txt").CreationTime=("01 March 2020 09:00:00") PS C:\> (Get-Item " file.txt").LastAccessTime=$(Get-Date -format o)Ĭool Tip: Windows grep command equivalent in CMD and PowerShell! Read more → PS C:\> (Get-Item " file.txt").LastWriteTime=$(Get-Date -format o) To change a file timestamps to the current time and date, execute the following commands from the PowerShell: PS C:\> (Get-Item " file.txt").CreationTime=$(Get-Date -format o) To create a new file, as a Windows touch equivalent, you can use one of these commands: C:\> type nul > " file.txt" The file timestamps in Windows can be changed using the built-in PowerShell commands.Ĭool Tip: Windows cat command equivalent in CMD and PowerShell! Read more → Windows `Touch` Command Equivalent If you simply want to create an empty file from the command-line prompt (CMD) or a Windows PowerShell – the type and copy commands can be considered as a Windows touch command equivalent. The touch command in Linux is used to change a file’s “ Access“, “ Modify” and “ Change” timestamps to the current time and date, but if the file doesn’t exist, the touch command creates it.
