windows-shell

How to get files selected in Explorer

放肆的年华 提交于 2019-12-22 01:31:19
问题 I have to edit an add-in that was written in visual studio in the vb.net language. What I need is a way to get a list of all the currently selected files from the active windows explorer window so that I can pass this to another function within the program. I'm not super experienced in visual studio (most of my experience has been in VBA which uses VB 6.0) so I'm looking for some advice before I spend too much time going down the wrong path. I was thinking of using the Windows Shell object. I

How to add submenu items to the Windows Explorer context menu?

こ雲淡風輕ζ 提交于 2019-12-21 17:20:04
问题 I can create a menu item in the Windows Explorer context menu by adding keys in the registry to HKEY_CLASSES_ROOT\Folder\shell . How can I create submenu items to the just created menu item? 回答1: I believe anything non-trival you'll have to create a Context Menu Handler. You'll have to create a COM object that will create the menus and carry out the commands as they're clicked. I've only done this using C++ and COM. I'm not sure if there are easier ways to do this. 回答2: Use SubCommands

Check if a php script is still running

十年热恋 提交于 2019-12-21 07:37:56
问题 I have a script that listens to a jabber server and responds accordingly. Though it's not supposed to stop, last night it did. Now I want to run a cron job every minute to check if the script is running, and start it if not. The question is, how do I check if a particular script is still running? Some solutions have been posted here, but those are all for Linux, while I am looking for a Windows solution. Any ideas please? Thanks. 回答1: A quick and dirty workaround could be for the script to

Creating an IShellItem instance for a non-existent file

假装没事ソ 提交于 2019-12-21 05:45:11
问题 How can I get an IShellItem object for a non-existent file (or directory)? SHCreateItemFromParsingName and SHCreateItemFromRelativeName fail with 0x80070002 (file not found) and ILCreateFromPath returns a NULL pidl. First I thought it might be impossible, but for example IFileSaveDialog creates such an IShellItem for its result (if you specify a new file in the dialog). 回答1: There is such a thing as a simple pidl and they can represent non-existent files. So I guess you want

How can I display the 'Send to' and 'Open With' context menus?

血红的双手。 提交于 2019-12-21 02:50:13
问题 Some time ago I asked about how to pop up the Windows context (right-click) menu for a certain file in Delphi. However, even if everything works (almost) OK, the 'Send to...' and 'Open with...' submenus don't have any items, even if when I right-click in Explorer on the same file name they work OK. (For example, 'Send to...' has 'Desktop (create shotcut)', 'Email recipient' etc.). How can I make those menus appear? 回答1: Raymond Chen wrote about this precise problem a few years ago in a many

Windows [cmd.exe] command to display a messagebox with timeout?

不羁的心 提交于 2019-12-20 12:35:34
问题 Note: This is a question-with-answer in order to document a technique that others might find useful, and in order to perhaps become aware of others’ even better solutions. Do feel free to add critique or questions as comments. Also do feel free to add additional answers. :) How can I display a messagebox by typing a single Windows command, e.g. in the Run dialog from the Start menu, or in the [cmd.exe] command interpreter? 回答1: One way is to use apparently undocumented functionality, namely

How can I immediately reload a folder icon when desktop.ini is changed

て烟熏妆下的殇ゞ 提交于 2019-12-19 17:45:51
问题 I'm trying to change folder icon programmatically using changing desktop.ini on the folder. I can set a icon, but can't change it immediately through changing "IconIndex". The icon is also changed in several seconds later. Is there anybody know how to change the icon immediately? 回答1: I already answered by commenting a reply at my question before. For more convenience, I will write an answer again. If you want to make any change at an appearance of any folder using Desktop.ini, use some of

Get the Windows Download folder's path

会有一股神秘感。 提交于 2019-12-19 01:17:06
问题 I have some Excel VBA code that requires knowing the Downloads folder path. How could I do it? Since you can move around the Downloads folder (and also Documents and most of those folders, via the folder properties), the environmental variables like %USERPROFILE% are useless to construct a path like %USERPROFILE%\Downloads , and WScript.Shell.SpecialFolders doesn't list the Downloads folder. I guess it has to be done reading the registry , but I'm clueless about that. Thanks! 回答1: Found the

How To Execute Windows Shell Commands (Cmd.exe) with Node JS

最后都变了- 提交于 2019-12-18 18:54:03
问题 I would like to C:\>ACommandThatGetsData > save.txt But instead of parsing and saving the data in the console, I would like to do the above command with Node.JS How to execute a shell command with Node.JS ? 回答1: You could also try the node-cmd package: const nodeCmd = require('node-cmd'); nodeCmd.get('dir', (err, data, stderr) => console.log(data)); 回答2: Use process.execPath(): process.execPath('/path/to/executable'); Update I should have read the documentations better. There is a Child

How to create an IconList property in the Windows Property System?

本小妞迷上赌 提交于 2019-12-18 16:58:53
问题 Currently, my property handler provides properties that can be displayed in Windows Explorer columns of type String . My goal is to extend the handler by a property of (display) type Icon , that can be added as a column to the details view of Windows Explorer. In this column, an icon should be displayed for each file item, e. g. the icon could represent a specific state of the file out of several possible states. However, I did not manage to assemble the necessary parts of creating a property