Joshua's Docs - Microsoft Windows - Assorted Notes and Dev Tips
Light

Also see general devops pages, and cmd-batch cheatsheet.

Issues deleting a file or folder

  1. Try takeown
    • takeown [FILE]
      • OR
    • takeown /f [FOLDER] /r /d y
  2. Try using Windows GUI and "change owner" under permission - make sure

to set to apply to all children, for both replacing the owner, and applying permissions recursively 3. Try seeing if an application/user has a lock on the file/folder. - Try using LockHunter first - AWESOME gui based tool that can unlock, kill blocking processes, and even automatically do the whole process - kill the lock and delete the folder - and integrated into the windows right click menu - for a more manual approach, try PROCEXP from sysinternals 4. Try booting into safe-mode and then deleting or changing permissions 5. Nuclear option - boot into Linux and rm rf that sob

Issues changing file properties / can't edit file details

If you are unable to edit file details (properties -> details) and/or they appear to be "locked", it probably means that Windows knows how to read the metadata of the file, but not write it. To make changes, you will need to use a third-party editor for that specific file type.

For example, a PDF might have embedded metadata that contains the author name associated with the content of the file, but the only way to make a change to this field would be to use a PDF editor, not the native Windows file explorer (even if Explorer can correctly display the value).

Filename and path limitations

Be aware that, even within Windows 10, there are still filename and path/directory limitations - https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file

Handy Hotkeys

These are just some of my favorites (most used):

For am exhaustive listing, see this handy reference page from MS.

Hotkey Action
WIN + {ARROW_KEY} Snap window to different side of screen
WIN + SHIFT + {ARROW_KEY} Quickly move window to different monitor
WIN + x Opens the "Quick Access Menu"
WIN + . Emoji picker
WIN + d Close all windows (show desktop)

Adjust Webcam / Camera Settings Dialog

You can use ffmpeg for this. First use this to find your camera name:

ffmpeg -list_devices true -f dshow -i dummy -hide_banner

Then, once you have the camera name, you can use:

ffmpeg -f dshow -show_video_device_dialog true -i video=%CAMERA_NAME%

Shout-out to this StackExchange answer, as well as this step-by-step guide.

Win APIs

Most integrations with the Win APIs (aka WinAPI, Win32) use low-level C, C++ or C#, but there are also some useful bindings / wrappers for other languages and abstractions:

Changing Webcam (& Other Video Device) Settings via Win32 APIs

I've only skimmed the surface of what this takes, but it looks like you can change video settings of a webcam (such as exposure and contrast) programmatically, with DirectShow / WDM Video Capture and the Strmif.h subset of the Win32 API.

More specifically, the IAMVideoProcAmp interface has getter and setter methods (e.g. IAMVideoProcAmp::Set) to read and write properties. AFAIK, this is how some popular programs (such as webcamoid), get and set video device properties on Windows.

Some related projects that use the IAMVideoProcAmp interface are:

Markdown Source Last Updated:
Tue Oct 12 2021 02:59:18 GMT+0000 (Coordinated Universal Time)
Markdown Source Created:
Tue Sep 24 2019 04:31:24 GMT+0000 (Coordinated Universal Time)
© 2024 Joshua Tzucker, Built with Gatsby
Feedback