ContextMenuForWindows11
ContextMenuForWindows11 copied to clipboard
Feature Request: Executing a command instead of a shortcut.
This is now.
It's desirable
Maybe I can use the command, but it's not working for some reason. Also a question, is it possible to add hidden startup of batches, or commands, so that they do not open a console window every time
Executing a command instead of a shortcut
don't know what you mean... The "exe" does not need to add parameters
exe: ssh
param: [email protected]
or
exe: cmd.exe
param: cmd /k ...
but will add a switch to hide the window
Executing a command instead of a shortcut
don't know what you mean... The "exe" does not need to add parameters
exe: ssh param: [email protected] or exe: cmd.exe param: cmd /k ...but will add a switch to hide the window
There is a plugin in flow launcher https://github.com/mantasjasikenas/flow-launcher-shortcuts-plugin which allows you to stupidly run a command when running a shortcut. moreover, you can choose which terminal manager to do this through. it would be nice to make a separate field for the usual commands run from the console (cmd, pwsh, powershell(pwsh = powershell 7).
as a last resort, you can give the user to specify his terminal application if he has installed some kind of left analog of powershell
And how can I compile a package?
u can build from source or use msix editor to modify package
1.build from source
install vs2019 with desktop uwp sdk https://github.com/ikas-mc/ContextMenuForWindows11/blob/main/build.md and https://github.com/ikas-mc/ContextMenuForWindows11/blob/main/.github/workflows/build.yml
2. msix editor
https://github.com/ikas-mc/ContextMenuForWindows11/wiki/Create-Custom-Package
Any way to execute some command like Copy-Item? I want to implement a "Duplicate here" button but have found no way. Even cmd.exe -> (here is the execute command) doesn't work
@gheescoo use poweshell script
{
"title": "Duplicate Here",
"index": 101,
"exe": "powershell.exe",
"param": "-NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\test\\Documents\\scripts\\duplicate-file.ps1\" \"{path}\"",
"icon": "%SystemRoot%\\System32\\shell32.dll,54",
"acceptDirectoryFlag": 0,
"acceptFileFlag": 4,
"acceptMultipleFilesFlag": 0,
"showWindowFlag": -1
}
param(
[string]$p,
[string]$suffix = '-Copy'
)
if(!$p){$p=Read-Host 'no input file path'}
if(!(Test-Path -LiteralPath $p)){Write-Error 'file not exists'; exit 1}
$dir = Split-Path -Parent $p
$name = [IO.Path]::GetFileNameWithoutExtension($p)
$ext = [IO.Path]::GetExtension($p)
function Get-NewName([string]$dir,[string]$name,[string]$ext,[string]$suffix){
$first = Join-Path $dir ($name + $suffix + $ext)
if(!(Test-Path -LiteralPath $first)){ return $first }
$i = 2
while($true){
$cand = Join-Path $dir ("{0}{1} ({2}){3}" -f $name,$suffix,$i,$ext)
if(!(Test-Path -LiteralPath $cand)){ return $cand }
$i++
}
}
$dst = Get-NewName $dir $name $ext $suffix
Copy-Item -LiteralPath $p -Destination $dst -Force
$dst
change C:\Users\test\Documents\scripts\duplicate-file.ps1 to your path