Blog entries with tag “Microsoft

PowerShell 6.1.0 (preview) messes verbs of directories, causing Previous Versions to open previous verions of a directory in PowerShell

Issue #6799 in PowerShell repository on GitHub raises the question why Previous Versions is opening previous versions of a directory in PowerShell, instead of File Explorer as expected. The reason is that PowerShell 6.1.0 (preview) installer creates a context menu to open the shell on any folder. However, it unfortunately names the verbs as open/runas, which is very dangerous since they are canonical and do not make much sense for a folder. Related is issue #7815, where shortcuts to a folder are opened in PowerShell.

用 Outlook 对象模型辅助学术日历管理

日历是一个很棒的时间管理工具,作为学生,一个常见的需求是把课程表导入日历。这就引出了好几个需要考虑的问题。我经过几个学期的摸索,实现了一个对自己完全够用的日历管理工具。

用 Outlook 对象模型辅助学术日历管理

Outlook 2016 GUI creates an appointment with extraneous attendee, causing Outlook.com and Outlook for iOS to show it as a meeting

Outlook 2016 GUI always creates an event with at least one attendee, which makes Outlook.com and Outlook for iOS have difficulty correctly interpreting the appointment. Instead, they think it is a meeting. However, if you create the event with Outlook object model, there is a good chance the event is created neatly. In addition, events created on Outlook.com or in Outlook for iOS are always neat.

Hosting a preview handler in WPF, correctly, part 2: interop

Continuing ‘Hosting a preview handler in WPF, part 1: UI and file associations’, we will do the major COM interop in this entry. Many people have failed to host the handler correctly because of careless implementation, so look carefully! Also, we will demonstrate some broken preview handlers, including ‘Adobe PDF Preview Handler for Vista’, ‘Microsoft Word previewer’ and ‘Microsoft PowerPoint previewer’.

Windows 10 自动更新重启的观察

我之前在知乎问题“为什么很多人要禁止 Windows 10 自动更新”下多个回答的评论区宣传 ShutdownBlockReasonCreate 这个 API,尝试“教育”开发者正确处(阻)理(止)Windows 10 自动更新重启带来的关键任务被终止的问题,还因为这个被人挂了。一开始我抱着怀疑的态度提出的方法,之后不知什么原因就假设这个 API 确实有效了——我当时已经知道该 API 不能其效果的情况,但是我没料到“大更新”的时候 Windows 真的会用那么暴力的方法重启电脑。本文记录了一些我的观察,并从使用者的角度给出一些关于 Windows 10 自动更新处理上的建议。

Windows 10 自动更新重启的观察

Windows Credential User Interface with secure attention sequence: not even bad

Ever since I used Windows NT (for me, the first Windows NT I used is Windows XP), I’ve been familiar with the importance of Ctrl+Alt+Delete. The combination is known as the secure attention sequence for Windows. In an uninfected copy of Windows, the sequence is handled exclusively by Windows, and is used to thwart trojan dialogs luring users’ credentials. Requiring SAS before Welcome Screen is a quite usable security feature. However, it is not the case for Credential User Interface.

NTFS DELETE_CHILD access and ‘the directory is not empty’

Someone wanted to know how to create a file that denies itself from being removed, yet found he could still remove the file even denying DELETE access from Everyone. The reason is that there is DELETE_CHILD access on its containing directory. How does this relate to ‘the directory is not empty’?

PowerShell codebase misuses SHEmptyRecycleBin function in Clear-RecycleBin cmdlet

Clear-RecycleBin is a cmdlet that clears your recycle bin. Internally, it calls SHEmptyRecycleBin function. It has been malfunctioning for a long time: when you run the cmdlet for the first time in a PowerShell session with Force switch on, it produces an ErrorRecord. Further investigation shows that it is detecting error status of SHEmptyRecycleBin the wrong way. To make things worse, SHEmptyRecycleBin is really bad at error handling.

PowerShell codebase misuses SHEmptyRecycleBin function in Clear-RecycleBin cmdlet

My High Contrast themes

High Contrast theme that is great for daily use, with extra large cursor. Updated one year later: I created a theme that can be used to simulate Windows Standard. Check it out!

My High Contrast themes

Don’t risk losing your purchased music by using Groove Music to store them

Groove Music allows the user to store their music collection, including songs available via Music Pass subscription, those purchased from the Store, those stored on your OneDrive and those stored locally. This gives the users false impression that purchased music are secured by Microsoft’s service so they’re never lost.

我的信仰之路

我是一个软粉,可能以后变成软黑也不一定。持续更新。

Windows PowerShell 的二进制管道

PowerShell 在众 shell 中最突出的特色就是面向对象;然而,世界上还有很多命名是专为字节流管道设计的(兼容性大坑)。PowerShell 对待字节流管道那是十分 nasty!我写的这个小工具可以在对象和字节流之间做完美的润滑。

Closing Windows Store apps

Learn the meaning of different gestures, buttons and hotkeys to ‘close’ Windows Store apps. And you have to learn it by heart like French conjugation.

Closing Windows Store apps