ikas-mc / ContextMenuForWindows11

Add Custom Context Menu For Windows11
GNU Lesser General Public License v3.0
1.85k stars 90 forks source link

In the parameters, the path to the penultimate folder #126

Closed Sta1917 closed 2 months ago

Sta1917 commented 4 months ago

Instead of C:\Users\Admin\Desktop returns C:\Users\Admin I tried "path" and "%~dp0"

In the old menu, the command works correctly

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\_CreateFolderDate\command]
@="\"C:\\TemplatesFolders\\create_folder_date.cmd\" \"%~dp0\""

ContextMenuForWindows11 Version: 3.8.0 Windows 11 Pro Build 22621.ni_release.220506-1250

image

ikas-mc commented 4 months ago

mkdir.cmd

@echo off
set "ymd=%date:~,4%%date:~5,2%%date:~8,2%"
mkdir %~f1\%ymd%

2024-05-05 044343

menu config(v5.0+)

{
  "title": "New Folder",
  "exe": "F:\\mkdir.cmd",
  "param": " \"{path}\"",
  "icon": "C:\\WINDOWS\\System32\\SHELL32.dll,4",
  "acceptDirectory": false,
  "acceptDirectoryFlag": 7,
  "acceptFile": false,
  "acceptFileFlag": 0,
  "acceptMultipleFilesFlag": 0,
  "index": 0
}