windows-shell

Why don't Windows Shell (cmd.exe) builtin commands read from stdin?

允我心安 提交于 2020-01-06 16:18:10
问题 Why don't Windows Shell (cmd.exe) built-in commands read from stdin? (or so it seems) Example: echo bar | set /p foo= 回答1: SET /P does read the input from the pipe, but it doesn't do any good because both sides of the pipe are executed within new cmd.exe processes. So the newly defined variable is lost once the pipe sub-processes terminate. For more information, see the selected answer to the Stack Overflow question - Why does delayed expansion fail when inside a piped block of code? 来源:

PHP shell exec not working in html browser but working on cmd prompt

十年热恋 提交于 2020-01-06 06:50:06
问题 I am running PHP 5.2.14 on Apache/2.2.16 (Win32) and I have a script to run a shell command, which when tested in the command prompt works well but in browser mode (html), it doesnt. Scripts: mybatfile.bat REM ... REM process some folder details REM code which does not work in browser mode but works in cmd mode C:/somfolder/bin/mysqldump -u abc -pabcdef --result-file="C:/Apache22/somfolder/DBbackup/DBbackup.%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%.sql" --dump-date --log-error="C:/Apache22/somfolder

Can I differentiate between single and double clicks on the system tray icon?

十年热恋 提交于 2020-01-06 02:52:07
问题 I create my system tray icon using Shell_NotifyIcon and then trap its WM_LBUTTONDBLCLK notifications for when a user double-clicks the icon (I use it show a dialog window.) I also trap WM_RBUTTONDOWN notifications to show the context menu. Now I'm thinking that it would be nice to show a context menu after a single left click. But how do I do that? If I trap WM_LBUTTONDOWN and show my context menu it works fine. But then when someone double-clicks the icon, it first shows my context menu and

How to register a Property Handler on folders?

一世执手 提交于 2020-01-04 08:19:06
问题 I built a virtual filesystem (not a namespace extension) for Windows which acts as a frontend of our document management server consisting of files and folders. In order to be able to display some metadata of the DMS objects in Windows Explorer as additional selectable columns, I successfully provided properties to the Windows Property System by implementing a COM Property Handler. Wheras normal property handlers focus on specific file types for which they feel responsible, my Property

HowTo: Display progress dialog using IFileOperation

会有一股神秘感。 提交于 2020-01-03 01:51:11
问题 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

Showing a Windows context menu for multiple items

旧城冷巷雨未停 提交于 2020-01-01 18:15:30
问题 I have an application that lists files, and I allow the user to right-click on a file and my application shows the Windows context menu for the selected file. I use SHParseDisplayName to get a pidl for a filename. Then I bind to the parent object: IntPtr pidlLast = IntPtr.Zero; SHBindToParent(pidl, typeof(IShellFolder).GUID, out oShellFolder, out pidlLast); After I have the parent I can get build the context menu: IntPtr result = IntPtr.Zero; IShellFolder shellFolder = (IShellFolder

Showing a Windows context menu for multiple items

我只是一个虾纸丫 提交于 2020-01-01 18:15:08
问题 I have an application that lists files, and I allow the user to right-click on a file and my application shows the Windows context menu for the selected file. I use SHParseDisplayName to get a pidl for a filename. Then I bind to the parent object: IntPtr pidlLast = IntPtr.Zero; SHBindToParent(pidl, typeof(IShellFolder).GUID, out oShellFolder, out pidlLast); After I have the parent I can get build the context menu: IntPtr result = IntPtr.Zero; IShellFolder shellFolder = (IShellFolder

What's the difference between *.bat and *.cmd file? [duplicate]

白昼怎懂夜的黑 提交于 2019-12-31 11:03:36
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Windows batch files: .bat vs .cmd? Hi, I am learning Windows Batch programming and come across this question: What's the difference between .bat and .cmd file? If they are the same, why need 2 of them? BTW, what's the difference between command.com and cmd.exe ? 回答1: .bat files are left-overs from DOS. .cmd files are for Window NT command processor or higher, and have more capabilities (some looping structures,

What's the difference between *.bat and *.cmd file? [duplicate]

你说的曾经没有我的故事 提交于 2019-12-31 11:02:56
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Windows batch files: .bat vs .cmd? Hi, I am learning Windows Batch programming and come across this question: What's the difference between .bat and .cmd file? If they are the same, why need 2 of them? BTW, what's the difference between command.com and cmd.exe ? 回答1: .bat files are left-overs from DOS. .cmd files are for Window NT command processor or higher, and have more capabilities (some looping structures,

How to create a right-click context shell shortcut “edit with Emacs”?

与世无争的帅哥 提交于 2019-12-31 08:13:19
问题 Notepad++ automatically adds a shell shortcut so that when you're in Windows Explorer, you can right-click on a file and select "edit with Notepad++". How can I do the same with emacs? I am using GNU Emacs 22.3 for Windows. 回答1: Here's what I have - similar to some other answer. Create a new text file somewhere called emacs-conextmenu.reg (or anything-you-want.reg) and paste the following in: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell] [HKEY_CLASSES_ROOT\*\shell