Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c6c08c7
initial, menu ok
jurakovic Apr 10, 2025
440e733
install functions
jurakovic Apr 11, 2025
b013a2a
install for both files and folders
jurakovic Apr 11, 2025
9ca3fd5
selected file/folder arg
jurakovic Apr 11, 2025
ffea535
multiselect (not working correctly, runs command for each file)
jurakovic Apr 11, 2025
a32cd08
copy ok
jurakovic Apr 11, 2025
f380fb1
paste dc ok
jurakovic Apr 11, 2025
cb75f47
paste dm dcdm ok
jurakovic Apr 11, 2025
dd04cbc
guard empty clipboard
jurakovic Apr 11, 2025
f428481
guard datetime format
jurakovic Apr 11, 2025
8040b6f
datetime format const
jurakovic Apr 11, 2025
fa9b088
install menu and cli options
jurakovic Apr 11, 2025
b12c6b9
fix for path or name with space
jurakovic Apr 11, 2025
dd23803
merge files and rename to tsch
jurakovic Apr 12, 2025
e08733d
rm clip file on uninstall
jurakovic Apr 12, 2025
829191f
update install/uninstall messages; suppress reg.exe output
jurakovic Apr 12, 2025
6c51480
add help and version args
jurakovic Apr 12, 2025
c9bb014
rename and reorder context menu items
jurakovic Apr 12, 2025
2fb7d06
highlight diff
jurakovic Apr 12, 2025
903b9f8
highlight different datetime parts
jurakovic Apr 12, 2025
d689594
set (new) color
jurakovic Apr 12, 2025
f1104ee
remove dim; add spaces on output
jurakovic Apr 12, 2025
ad748aa
pause/exit handling
jurakovic Apr 12, 2025
2c747a4
change paste items label
jurakovic Apr 12, 2025
1da1b60
cleanup
jurakovic Apr 13, 2025
9d54090
admin check on install
jurakovic Apr 13, 2025
e93915c
add readme, licence, gh pages config
jurakovic Apr 13, 2025
82f407b
update readme
jurakovic Apr 13, 2025
5199cc4
add requirements (bash), add installation
jurakovic Apr 13, 2025
ec884ef
add screenshots
jurakovic Apr 13, 2025
893fd9c
add limitation
jurakovic Apr 13, 2025
bf6d5a9
add references
jurakovic Apr 13, 2025
0efd7b2
final minor script updates
jurakovic Apr 13, 2025
2f7004e
add disclaimer
jurakovic Apr 13, 2025
c145446
v1
jurakovic Apr 13, 2025
7a62dd8
readme updates and fixes
jurakovic Apr 13, 2025
40ac892
rename to tscp
jurakovic Apr 13, 2025
915753f
rename repo only
jurakovic Apr 13, 2025
bb09d2f
merge master -> init (force link unrelated branches)
jurakovic Apr 13, 2025
da160ca
update readme
jurakovic Apr 14, 2025
6abe0e0
add help -? cli option
jurakovic Apr 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 jurakovic

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
119 changes: 119 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@

# Timestamp Copy

Timestamps Copy is a lightweight Bash and PowerShell-based script that integrates directly into the Windows File Explorer context menu, enabling you to **copy** and **paste** file and folder timestamps with ease.

This solution is especially useful when you need to preserve or replicate Date Created and Date Modified values across files or folders – ideal for organizing backups, restoring files, or syncing metadata.

### Features

#### Explorer Context Menu Integration

Adds convenient right-click options for both files and folders:

![ContextMenu](img/contextmenu.png)

#### Copy Mode

Stores the selected file or folder's Date Created and Date Modified timestamps for reuse.

#### Paste Mode

Applies the previously copied timestamps to the currently selected file or folder.

#### Selective Timestamp Paste

Use the specific `Paste 'Date Created'` or `Paste 'Date Modified'` options to update only the desired timestamp.

### Usage

Right-click on a file or folder and choose `Copy` under the context menu.
This saves the timestamps to a temporary location ("clipboard").

Right-click on another file or folder and choose:

`Paste` – to apply both timestamps
`Paste 'Date Created'` – to apply only the Date Created
`Paste 'Date Modified'` – to apply only the Date Modified

Each entry starts Bash terminal and runs the [`tscp.sh`](tscp.sh) script with the appropriate parameters (example screenshots below).

### Requirements

- Windows 10/11 (tested on Windows 11 24H2)
- PowerShell 5.1 or later
- Bash (recommended: Git for Windows)
- Administrator privileges (required for installation)

> **Bash** can be installed on Windows in several ways, including:
> - [Git for Windows](https://gitforwindows.org) (comes with the MSYS2 runtime – [Git for Windows flavor](https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md))
> - [MSYS2](https://www.msys2.org)
> - [Cygwin](https://cygwin.com)
> - [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install)
>
> The recommended way is to use **Git for Windows** as it provides a lightweight and user-friendly environment for running Bash scripts on Windows.
> This script is designed to work with Git for Windows and the official MSYS2 runtime. It doesn't work with Cygwin or WSL. It could work with some minor modifications, and while I don't plan to do it myself, feel free to update it to suit your own needs.

### Installation

1. Clone the repository.
```bash
git clone https://github.com/jurakovic/timestamp-copy.git
```
2. Open an elevated Bash terminal ('Run as Administrator').
3. Navigate to the directory where you cloned the repository.
```bash
cd timestamp-copy
```
4. Add the context menu entries. This can be done in two ways.
Run the `tscp.sh` script
```bash
./tscp.sh
```

and then choose the option `i`
```text
Timestamp Copy (1.0.0)

[i] Install
[u] Uninstall

[q] Quit

Choose option:
```

or run the script with the `-i` option to install it directly:
```bash
./tscp.sh -i
```

### Screenshots

Copy
![Copy](img/copy.png)

Paste
![Copy](img/paste.png)

### Limitation

This script is designed to work with **only one selected file or folder at a time**. While it does appear in the context menu when multiple items are selected, it will be executed **independently for each item**. This can lead to unexpected behavior. For accurate and predictable results, always use it with a single selection.

### Disclaimer

This script is provided **as-is**, without any warranties or guarantees of fitness for a particular purpose. It was created solely for educational and experimental use, and I do **not** intend to actively support or maintain it. While it should work reliably in most cases, use it at your own risk.

### Future Plans

In the future, I plan to develop a more robust and user-friendly version written entirely in PowerShell for a more native Windows experience.

---

### References

<https://stackoverflow.com/questions/20449316/how-add-context-menu-item-to-windows-explorer-for-folders>
<https://www.tomshardware.com/software/windows/how-to-add-custom-shortcuts-to-the-windows-11-or-10-context-menu>
<https://blog.sverrirs.com/2014/05/creating-cascading-menu-items-in.html>
<https://learn.microsoft.com/en-us/windows/win32/shell/context-menu-handlers>
<https://mrlixm.github.io/blog/windows-explorer-context-menu/>
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
remote_theme: jurakovic/cayman-blue
google_analytics: G-233EMZJM16
dark_theme: true
Binary file added img/contextmenu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/paste.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tscp.ico
Binary file not shown.
Loading