-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PowerToys New+ variable support in template filenames -- documentation related updates #5285
base: docs
Are you sure you want to change the base?
Changes from 10 commits
b41b3cd
fe648d0
0fe7113
f90f9ac
77db49d
ea3a020
835e826
55c71ef
00321c9
ed9b5cc
347a0a8
8b63d67
e2ed98b
b066093
67fce04
c866728
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: PowerToys New+ for Windows | ||
description: A tool that enables you to create files and folders from a personalized set of templates, directly from the File Explorer context menu. | ||
ms.date: 07/13/2024 | ||
ms.date: 01/25/2025 | ||
ms.topic: article | ||
no-loc: [PowerToys, Windows, New+, New, NewPlus, Win] | ||
--- | ||
|
@@ -44,4 +44,62 @@ The option enables you to toggle the display of filename extensions. When this o | |
|
||
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. | ||
|
||
### Behavior | ||
|
||
#### Replace variables in template filename | ||
|
||
This setting causes supported variables in filenames, including in files within subfolders, to be replaced when the template is copied. The default setting of this option is enabled. | ||
|
||
Note: Any invalid filename characters are replaced with spaces. | ||
|
||
##### Examples | ||
|
||
| Example template filename | Would on copy expand to | | ||
| :--- | :--- | | ||
|`$YYYY-$MM-%DD, $hh $mm $ss - $PARENT_FOLDER_NAME by %USERNAME%` | `2024-11-22, 12 08 54 - PowerShell project by cgaarden` | | ||
|`File where variable value contains invalid characters %USERPROFILE%` | `File where variable value contains invalid characters C Users cgaarden` | | ||
|
||
##### Date and time related variables | ||
|
||
These date and time related variable patterns are the same as those used by PowerRename and are case-sensitive. | ||
|
||
| Variable | Explanation | | ||
| :--- | :--- | | ||
| `$YYYY` | Year, represented by a full four or five digits, depending on the calendar used. | | ||
| `$YY` | Year, represented only by the last two digits. A leading zero is added for single-digit years. | | ||
| `$Y` | Year, represented only by the last digit. | | ||
| `$MMMM` | Name of the month. | | ||
| `$MMM` | Abbreviated name of the month. | | ||
| `$MM` | Month, as digits with leading zeros for single-digit months. | | ||
| `$M` | Month, as digits without leading zeros for single-digit months. | | ||
| `$DDDD` | Name of the day of the week. | | ||
| `$DDD` | Abbreviated name of the day of the week. | | ||
| `$DD` | Day of the month, as digits with leading zeros for single-digit days. | | ||
| `$D` | Day of the month, as digits without leading zeros for single-digit days. | | ||
| `$hh` | Hours, with leading zeros for single-digit hours. | | ||
| `$h` | Hours, without leading zeros for single-digit hours. | | ||
| `$mm` | Minutes, with leading zeros for single-digit minutes. | | ||
| `$m` | Minutes, without leading zeros for single-digit minutes. | | ||
| `$ss` | Seconds, with leading zeros for single-digit seconds. | | ||
| `$s` | Seconds, without leading zeros for single-digit seconds. | | ||
| `$fff` | Milliseconds, represented by full three digits. | | ||
| `$ff` | Milliseconds, represented only by the first two digits. | | ||
| `$f` | Milliseconds, represented only by the first digit. | | ||
|
||
##### Special variables | ||
|
||
These special variables are case-sensitive, so they will only work when written exactly as shown here. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sentence can be shortened. Like, "Note: Case sensitive" should suffice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I agree - to me and you - yes :-) but I think there a lot of people who don't really know what case-sensitive/insensitive mean. |
||
|
||
| Variable | Explanation | | ||
| :--- | :--- | | ||
| `$PARENT_FOLDER_NAME` | Expands to the name of the parent folder. | | ||
|
||
##### Environment variables | ||
|
||
These variables are case-insensitive, meaning you can write them in a mix of uppercase or lowercase. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same. Nit: to me, the word "write" sounds more like "handwriting", versus "type" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reworded slightly to hopefully avoid confusion |
||
|
||
Each `%environment_variable%` in the file and folder names will be replaced with the value of the corresponding environment variable. | ||
|
||
For instance, %USERNAME% will be replaced with the name of the current Windows user. | ||
|
||
[!INCLUDE [install-powertoys.md](../includes/install-powertoys.md)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filename:
We are using "filename" in the New+ settings UI and also in the existing New+ documentation. Both filename and file name are valid but started with filename and prefer to be consistent throughout.
Updated to "Result"