windows-shell

taskkill to differentiate 2 images by path

六眼飞鱼酱① 提交于 2019-12-10 01:14:07
问题 How to kill a process by name and orginiated from a particular path using taskkill? taskkill /F /IM certainly it cant differentiate 2 process started from two different locations C:\Dir1 and C:\Dir2 Does tasklist has any switch to get the path name 回答1: taskkill cannot do it. But you could use PowerShell if it's an option: (Get-WmiObject Win32_Process | Where-Object { $_.Path.StartsWith('C:\Dir1') }).Terminate() 回答2: Based on Joey's answer: wmic Path win32_process Where "CommandLine Like '%

Get list of selected files from Windows Desktop

跟風遠走 提交于 2019-12-09 16:12:11
问题 I am trying to get a list of selected files from the Windows Desktop and the Explorer Windows. The requirement is that I should be able to retrieve the current selection from the active explorer window or the Desktop. I have managed to put together the following code, after going through online resources, but it does not provide a list of selected items from the Desktop. ArrayList selected = new ArrayList(); var shell = new Shell32.Shell(); IntPtr handle = IntPtr.Zero; handle =

Send text to standard input of a Windows console app

风流意气都作罢 提交于 2019-12-09 13:09:05
问题 I am trying to write a .bat file to automate some shell commands. Most of the commands are easy and I can just put them into the batch file directly, but there is one command which instead of taking command line parameters, expects you to type in the options you want using "the standard input". I'm not exactly sure what that means. Can someone tell me how to do this? The text I would like to be entered is the contents of one of the files in the directory: "options.txt" which I want to

C#: How to use SHOpenFolderAndSelectItems [duplicate]

≯℡__Kan透↙ 提交于 2019-12-09 11:49:43
问题 This question already has answers here : C#: How to open Windows Explorer windows with a number of files selected (5 answers) Closed last year . Could someone give an example on how to use the shell function SHOpenFolderAndSelectItems from C#? I don't quite get how to use these kind of functions and couldn't find it on pinvoke.net... =/ Say I have three files called X:\Pictures\a.jpg X:\Pictures\s.jpg X:\Pictures\d.jpg I then want to open up the X:\Pictures folder with a.jpg , s.jpg and d.jpg

How do I remove the “wrench” button on the balloon tooltip? [closed]

自作多情 提交于 2019-12-08 20:47:51
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I want to hide the wrench button on the balloon tooltip Does anyone know how? Is it possible to disable/remove the wrench button next

Open a folder in Windows Explorer and select a file works second time only

倾然丶 夕夏残阳落幕 提交于 2019-12-08 17:13:55
问题 Using the code described in this answer of the SO posting "Open folder and select the file", I've created this function: public static void OpenExplorerAndSelectFile(string filePath) { Process.Start( @"explorer.exe", string.Format(@"/select, ""{0}""", filePath)); } This function works well, with one small issue: Calling the function for the first time for a specific file, Windows Explorer is correctly shown with the folder of the file, but it does not select the file . Calling the same

Update free space amount displayed in Windows Explorer

廉价感情. 提交于 2019-12-08 11:21:32
how to update free space amount displayed in Windows Explorer for a drive ? Suppose Windows Explorer is opened and some files are deleted programmatically. Windows Explorer will not be refreshed to show the new free space available. So, I tried to use SHChangeNotify like this (Delphi code) : ws := 'C:\'; SHChangeNotify (SHCNE_FREESPACE, SHCNF_PATH, PWideChar(ws), nil); but it doesn't update values reported in "Windows Explorer". Please help. If you are using Delphi 7, then SHCNF_PATH will map to the ANSI version, SHCNF_PATHA . In which case passing PWideChar is wrong. Write it like this: var

JclShell.ShellLinkResolve gets wrong data

依然范特西╮ 提交于 2019-12-08 07:29:18
问题 JclShell.TShellLink.Target gives back the wrong path: uses JclShell; ... var ThisShellLinkRecord: JclShell.TShellLink; ThisTargetExePath: string; begin JclShell.ShellLinkResolve('C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Xara\Xara Designer Pro X9\Xara Designer Pro X9.lnk', ThisShellLinkRecord); ThisTargetExePath := ThisShellLinkRecord.Target; ThisTargetExePath from the above code results as: C:\Program Files (x86)\Xara\Xara Designer Pro X9\DesignerPro.exe Please note the (x86) in

Update free space amount displayed in Windows Explorer

天涯浪子 提交于 2019-12-08 04:14:25
问题 how to update free space amount displayed in Windows Explorer for a drive ? Suppose Windows Explorer is opened and some files are deleted programmatically. Windows Explorer will not be refreshed to show the new free space available. So, I tried to use SHChangeNotify like this (Delphi code) : ws := 'C:\'; SHChangeNotify (SHCNE_FREESPACE, SHCNF_PATH, PWideChar(ws), nil); but it doesn't update values reported in "Windows Explorer". Please help. 回答1: If you are using Delphi 7, then SHCNF_PATH

HowTo: Display progress dialog using IFileOperation

本小妞迷上赌 提交于 2019-12-08 03:30:31
I’m trying to get a progress dialog to display for my copy operation in some sample code. I’m using IFileOperation because I found that using SHFileOperation will not display a progress dialog if the files have already been copied to the target location. My hope is that IFileOperation is a little more sophisticated and can handle that situation. Here’s the sample code I’ve tried…. CComPtr<IOperationsProgressDialog> opProgressDlg; HRESULT hr = opProgressDlg.CoCreateInstance(CLSID_ProgressDialog); CComPtr<IFileOperation> fileOp; hr = fileOp.CoCreateInstance(CLSID_FileOperation); hr = fileOp-