Is there a way to identify which shortcut was used to launch a script? Something that doesn't require any modification of the shortcut itself?
I know I can get the path of the script itself, but I can't seem to find a way to get the shortcut.
The need is because I am using different shortcut icons depending certain arguments present in the shortcut, and while I have a utility that processes all the shortcuts present, this utility doesn't get used all the time. I would like to be able to check each individual shortcut on use as well.
Related
I'm trying to setup a key binding in Eclipse to directly execute a background Java file. My file is called CodeChecker.java and it's sufficient for my purposes to run the main method without any arguments. I need to run it repeatedly and so I'm trying to setup a shortcut key to run it directly without having to bring up the Run... menu or having to bring up the file itself.
As far as I'm aware Eclipse is not able to offer this functionality directly. I've tried using a plugin called Practically Macro according to this answer Assigning a keyboard shortcut for a specific Eclipse build configuration. But this answer is horribly out of date and doesn't work any longer.
So I'm wondering if Practically Macro can still be used to achieve this? Any other solution, plugin, script or otherwise would be equally welcome.
In Atom, hitting Cmd+N brings up a window where you can type in basically any path to create any file or folder anywhere in the project. In VSCode, hitting Cmd+N brings up a dialog where you can create a file in the currently focused folder, and I believe you can type a path to create a file in a subfolder (whether it exists or not), but not as flexibly as in Atom.
Is there way to do it Atom-style in VSCode?
I don't know for sure whether this is what you're looking for, but still there exists this plugin which can emulate the file/directory creation feature of Atom.
Since i use vscode-vim it's fairly easy to create new folders and files using command mode. If you're familiar with using terminal, then you can use shell commands to create file/dir.
I have no idea whether one could do what you had mentioned the proper way with vanilla vscode.
Hope this helps you somehow.
I have successfully modified the common attributes of a a shortcut using Powershell; things like changing the icon, setting it to run elevated, etc.
But, in the case of a shortcut to PowerShell itself, that passes a script as an argument, there are some more attributes in the Layout tab of properties, and I would like to be able to modify those attributes as well.
But I can't seem to find any reference to how to get at them.
FWIW, I have been using PS to do this programmatically like this, but I find it problematic when used across different OSs and different versions of PowerShell. So, looking at alternatives.
When I click the Windows button, I can type the name of an app and get completions in the menu to quickly find an app and run it.
But it looks like with PowerShell I must add the app's path to $ENV:Path which is very cumbersome to do per app. Is there a better way?
Kind of, but not really. PowerShell's tab completion function searches the current folder, known cmdlet names, and folders in the user and system path. Unless you want to rewrite the tab completion function yourself (which is possible, see PowerTab) you're stuck with that functionality.
You should be able to use Start-Process (alias start and saps), which does use some file association information similar to the Start Menu. However, you need to know the name of the application executable, not the friendly name you'd see on the Start Menu. You can't type Start-Process word. You'd have to say Start-Process winword, because the executable is winword.exe.
PowerShell is a modern command line, but it's still a command line. It doesn't help the user the same way the Windows search does because it doesn't make the same assumptions. PowerShell assumes you'll predominantly want to work with cmdlets, and that's really how most people use it, IMX. Unless you're managing servers, it's not meant to replace the GUI.
You can use tab completion with the folder names and the call operator, so you could type C:\Pro and hit tab and it will expand to (for example) & 'C:\Program Files\'. Note that it includes the call operator (&) for you here automatically, since the provider for file systems assumes you'll want it.
A trick I use is to create a batch file for things I use a lot from the command line and put that in a c:\tools folder, which is in my system path.
That way you don't have to add every executable to your path so it can find it with autocomplete.
I'm running Console2, which I believe is just an interface to windows cmd
I have a custom batch file that does most of my dirty work for me, but there are lot of commands in it now. Is there a way I can get a tap autocomplete working for it in the windows command prompt?
For example: my script is called rob.bat and it takes in a various number of arguments
It'd like to type rob set{Tab} and then have it cycle through
setup_envvars
setup_userprefs
setup_whateverothersetupscriptsIhave
Is there a way to do this?
Console2 has no special provisions for tab completion and instead relies on the program running within it to provide such features. Picture Console2 as little more than something that runs a console program hidden somewhere, regularly polls that hidden window for changes, and forwards all input to that window; this is, in essence, what's happening.
Note that Console2 does nothing special with cmd. You can run any shell within it. As for customizing tab completion, cmd offers nothing of that sort. You may be able to change this by installing clink, which has extension points for Lua code. Another option would be PowerShell, which has customizable tab completion out of the box, either by wrapping your program in a function that provides the necessary parameters, or by writing a custom TabExpansion or TabExpansion2 function.