Skip to content

Commit 0fe7113

Browse files
committed
New+ changes related to support for variables in template filenames
1 parent fe648d0 commit 0fe7113

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

hub/powertoys/newplus.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: PowerToys New+ for Windows
33
description: A tool that enables you to create files and folders from a personalized set of templates, directly from the File Explorer context menu.
4-
ms.date: 07/13/2024
4+
ms.date: 01/25/2025
55
ms.topic: article
66
no-loc: [PowerToys, Windows, New+, New, NewPlus, Win]
77
---
@@ -34,7 +34,7 @@ Template objects in the "Templates" folder can be files, folders, or shortcuts.
3434

3535
After the enablement toggle, the New+ Templates location setting is likely the most interesting one. By default, the template location is in your local app data folder, specifically at `%localappdata%\Microsoft\PowerToys\NewPlus\Templates`. However, these templates will not roam with you across devices. If you want a common set of templates across devices, a popular option is to change the template location to a folder that is synced with a cloud drive, such as OneDrive. This way, you can access your templates from any device.
3636

37-
### Display options
37+
### <a name="display_options"></a>Display options
3838

3939
#### Hide template filename extensions
4040

@@ -44,24 +44,26 @@ The option enables you to toggle the display of filename extensions. When this o
4444

4545
The option enables you to toggle the display of starting digits, spaces and dots. When this option is toggled off (the default), a file named "1. filename" will be displayed as is. However, when this option is toggled on, the template will be displayed as "filename". This is useful when using digits, spaces, and dots at the beginning of filenames to control the display order of templates.
4646

47-
### Filenaming options
47+
### <a name="behavior"></a>Behavior
4848

49-
#### Expand variables in filenames
49+
#### <a name="replace_variables"></a>Replace variables in template filename
5050

51-
With this option on (the default) certain variables in filenames will expand when the template file is copied. Any non-valid-filename charactors are replaced with spaces.
51+
With this option on (the default) supported variables in filenames, including in files within subfolders, will get replaced when the template is copied.
5252

53-
##### Examples
53+
Note: Any non-valid-filename characters are replaced with spaces.
54+
55+
##### <a name="replace_variables_examples"></a>Examples
5456

5557
| Example template filename | Would on copy expand to |
5658
| :--- | :--- |
5759
|`$YYYY-$MM-%DD, $hh $mm $ss - $PARENT_FOLDER_NAME by %USERNAME%` | `2024-11-22, 12 08 54 - PowerShell project by cgaarden` |
58-
|`File where variable value contains invalid charactors %USERPROFILE%` | `File where variable value contains invalid charactors C Users cgaarden` |
60+
|`File where variable value contains invalid characters %USERPROFILE%` | `File where variable value contains invalid characters C Users cgaarden` |
5961

6062
##### Date and time related variables
6163

62-
Note these variable patterns are the same as for PowerRename and are case-sensitive.
64+
These date and time related variable patterns are the same as for PowerRename and are case-sensitive.
6365

64-
| Variable pattern | Explanation |
66+
| Variable | Explanation |
6567
| :--- | :--- |
6668
| `$YYYY` | Year, represented by a full four or five digits, depending on the calendar used. |
6769
| `$YY` | Year, represented only by the last two digits. A leading zero is added for single-digit years. |
@@ -86,16 +88,18 @@ Note these variable patterns are the same as for PowerRename and are case-sensit
8688

8789
##### Special variables
8890

89-
Note these special variables are case-sensitive, so they will only work when written exactly as shown here.
91+
These special variables are case-sensitive, so they will only work when written exactly as shown here.
9092

91-
| Special variable | Explanation |
93+
| Variable | Explanation |
9294
| :--- | :--- |
9395
| `$PARENT_FOLDER_NAME` | will expand to the name of the parent folder. |
9496

9597
##### Environment variables
9698

97-
Note these variables are case-insensitive, so you can write them in upper or lowercase, as you prefer.
99+
These variables are case-insensitive, meaning you can write them in a mix of uppercase or lowercase.
100+
101+
Each `%environment_variable%` in the file and folder name, will get replaced by the value of that environment variable.
98102

99-
* `%environment_variable%`, will get replaced by the value of that environment variable.
103+
For instance, %USERNAME% will get replaced with the name of the current Windows user.
100104

101105
[!INCLUDE [install-powertoys.md](../includes/install-powertoys.md)]

0 commit comments

Comments
 (0)