I've seen how to open a new File explorer, e.g. explorer.exe /select,$path and select files in that new window, but how would I do this with an existing File explorer window, i.e. tell File explorer to select certain files, as if the user had clicked and highlighted those files?
I love Powershell, honestly I use it even when I know another language would be better. But this is no job for Powershell. I don't know to what end, you are "selecting files" in Explorer for, but it may be possible to accomplish your end goal without utilizing the GUI. If for some reason I don't understand you actually want to do what your are asking about in your question, I would use autoit to simulate key presses or clicks.
Related
I am looking for a way to open files in vscode that do not belong to the currently active workspace (and should not belong to it, this is not about multi-root-workspaces).
The ideal solution I could imagine would be a second explorer-panel that allows to browse the whole filesystem-tree and open files from it just like the built in explorer.
Is there maybe an extension for that I haven't found yet?
I am new to PowerShell scripting. I would like to know if i can check whether a html file is open. If it is opened, then i would like to re-open it after running the same script.
My script creates a html file and using Invoke-Item, i am opening it. The next time i run the same script, the updated html file gets opened in the new tab. I want my script to close the previously opened file right before opening the new one or some similar logic.
By using Invoke-Item you actually are asking Windows' Explorer to open the file with the default application that's registered for .html files. In out of the box configuration, that's Internet Explorer or Edge. This, of course, can be customized.
Depending on the browser used, there might be a COM interface for querying browser status. As how to do that is subject to another a question, as it really depends on the browser. Looking for, say, file handles might or might not work, as browsers tend to open files in read only mode - they are not supposed to modify it anyway.
Anyway, this sounds like another a XY problem. Please edit the question and describe what problem are you really trying to solve; maybe there's better a way.
Is there a way to manually enter perforce commands in the p4v GUI?
I'm relatively new to Perforce and find the GUI useful for most of what I need to do, but I can see situations where a one line command would be much easier than navigating through the GUI.
Example:
Opening a file for edit that is nested deep in the source tree; this takes many clicks when done in the GUI but would be a relatively short command with environment variables set for my most commonly used directories.
p4 edit -c NNNNNN $DIRECTORY/file
It would be great if the command entered was also added to the Log window. I really like being able to scroll through the Log to see everything I've done in a session.
The closest that exists right now is "File"->"Open Command Window Here" when you have a file selected in the file browsing pane. It will open a command line in that file's directory with all of the relevant environment set up.
Unfortunately, this won't give you unified Log, and you'll have to juggle a second window.
My app Folders Popup is using the command ComObjCreate("Shell.Application").Explore(strPath) to create a new Explorer window. I need a way to tell this new instance of Explorer to comply with the Navigation Pane setting decided by the user (to show or not show the pane) in previous Explorer windows.
Actually, this setting is not taken into account by default in the new instance created by the Shell command and users of my app who prefer to use Explorer without this navigation pane are annoyed to see it reappear when my app is opening a new Explorer. Is there any solution to this (except sending keys to the Explorer, what I prefer to avoid)?
Simpler is sometimes better ;)
The Run command isn't just for executables, it can also open non-executable files like images/documents (as long as their file type is associated) and especially folders:
myFolderPath = C:\Path\To\Folder
Run, %myFolderPath%
Generally, it makes sense to use built-in commands or functions if available, before incorporating ActiveX, COM objects or DLL calls; those should provide extra functionality, and not replace what AHK can do out of the box. That, of course, occasionally requires some digging into the docs, but it's worth it! AHK is one of the most well-documented automation scripting languages for Windows.
IDEs are wonderful for many things. But I dislike how they make me use a GUI for something I can do faster typing in a command line. For example, opening a known specific file. If I know the name of a file, from the command line I can just type the name of my editor and the filename. With tab-completion I can accomplish this very quickly in a reliable amount of time. No searching through output or moving my fingers off the keyboard.
Is there a way in Eclipse to open a known file simply by typing its path+filename? Maybe through a plugin?
The "Open Resource" shortcut (ctrl-shift-R) is almost it, but it only lets you type the name of the file, not the path. If you have several files of the same name in different directories, you must again hunt with the mouse for what you want.
Actually, if you are using Helios (Eclipse 3.6) you can use paths; for details, see "New features in Open Resource dialog" in that version's "New and Noteworthy" page.
Also, you can Tab to the list of results and use the arrows to pick the right one.
Well, there's the general File>Open option which is meant for opening arbitrary, but I don't know what that does if you point it to a file inside your workspace. This opens your normal platform open dialog which you might be more comfortable using quickly.
I think Open Resource is the closest you're going to get. You shouldn't have more than a couple of files with the same name, I would think, plus you can use wildcards to open files quickly. Also, remember that files you open more recently appear higher up the list of matches so you may find that the file you want is at/near the top of the list already.
In the "Open File" dialog, if you just start typing or paste from clipboard by Ctrl+V, the desired file will be selected.
The dialog before typing something:
The dialog after pasting the file location:
I'm using Neon.3 Release (4.6.3).