Windows

From HalfgeekKB
Jump to navigation Jump to search

This page relates to information about Microsoft Windows in its many hideous forms.

Kill a service that is stuck on "Starting"

If you don't know the service name of the service, it can be found by right-clicking in the Services list and opening Properties; it's the first thing in the General tab.

Open cmd.

Find the PID of the task being run by the service:

 sc queryex SERVICENAME

Terminate with extreme prejudice:

 taskkill /f /pid PIDNUMBER

Optionally, try starting it again:

 net start SERVICENAME

Artificially add WxH to the possible display resolutions

The following commands, run as administrator, adds 1920x1080 as the default resolution of the current display adapter. Restart may be required. Useful for serving VNC from VirtualBox.

@echo off
REM Cribbed from https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/3bab12c3-b323-42f1-aee0-107b8ea1da64/windows-7-change-display-resolution-from-a-service?forum=windowsgeneraldevelopmentissues
FOR /F "TOKENS=2 delims={}" %%a in ('"REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Video /s /f VolatileSettings"') do set VIDEOCARD=%%a
echo Got video card {%VIDEOCARD%}
echo Setting HKLM
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}\0000 /v DefaultSettings.XResolution /t REG_DWORD /d 1920 /f
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}\0000 /v DefaultSettings.YResolution /t REG_DWORD /d 1080 /f
echo Setting HKCC
REG ADD HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\VIDEO\{%VIDEOCARD%}\0000 /v DefaultSettings.XResolution /t REG_DWORD /d 1920 /f
REG ADD HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\VIDEO\{%VIDEOCARD%}\0000 /v DefaultSettings.YResolution /t REG_DWORD /d 1080 /f
echo Done

See also

  • Cygwin, a POSIX layer on Windows that provides a cheat for unported unix apps.
  • Overhaul, a list of reminders concerning what to do with a fresh install of any OS.