{"id":158,"date":"2013-01-10T15:11:12","date_gmt":"2013-01-10T20:11:12","guid":{"rendered":"http:\/\/www.geekythings.me\/?p=158"},"modified":"2013-01-10T15:11:12","modified_gmt":"2013-01-10T20:11:12","slug":"change-hdmi-video-sound-via-the-command-line-in-windows-7","status":"publish","type":"post","link":"https:\/\/www.geekythings.me\/?p=158","title":{"rendered":"Change HDMI Video \/ Sound via the command line in Windows 7"},"content":{"rendered":"<p>I recently was involved in getting a friend with nice big flat panel TV who wanted to display his computer on TV in a simple way The way you normally do it is manually enable both the video for HDMI and the sound for HDMI as well by digging into the control panel. Since he is a bit of a novice with computers, I decided to script the process for him.<\/p>\n<p>The following is the batch file I gave him:<\/p>\n<p>@echo off<br \/>\ncd\\u<br \/>\ncd nircmd<br \/>\nEcho HDMI mode ON<br \/>\nDisplaySwitch.exe \/external<br \/>\nnircmd.exe setdefaultsounddevice <i>&#8220;Name of HDMI Sound&#8221;<\/i> 0<br \/>\nPause<br \/>\nEcho HDMI mode OFF<br \/>\nnircmd.exe setdefaultsounddevice <i>&#8220;Name of Internal Sound&#8221;<\/i> 0<br \/>\nDisplaySwitch.exe \/internal<\/p>\n<p>This script will enable the TV display and change the Default Sound Device to HDMI Then Pause. If you hit a key again, it will change the settings back.<\/p>\n<p>To use this script you will need:<\/p>\n<p>1. The names of the sound devices on this system. You get these in Windows 7 by going to Start &gt; Control Panel&gt; Manage Audio Devices. Your HDMI TV will need to plugged into the computer.<\/p>\n<p><a href=\"http:\/\/www.GeekyThingz.com\/?attachment_id=159\" rel=\"attachment wp-att-159\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-159\" alt=\"Sound Device in Windows 7 \" src=\"http:\/\/www.GeekyThingz.com\/wp-content\/uploads\/2013\/01\/Capture-277x300.png\" width=\"277\" height=\"300\" srcset=\"https:\/\/www.geekythings.me\/wp-content\/uploads\/2013\/01\/Capture-277x300.png 277w, https:\/\/www.geekythings.me\/wp-content\/uploads\/2013\/01\/Capture.png 424w\" sizes=\"auto, (max-width: 277px) 100vw, 277px\" \/><\/a><\/p>\n<p>My devices were &#8220;SAMSUNG-1&#8221; for HDMI sound and &#8220;Speakers \/ Headphones&#8221; for internal sound.<\/p>\n<p>2. The tool <a title=\"Nircmd\" href=\"http:\/\/www.nirsoft.net\/utils\/nircmd.html\" target=\"_blank\">Nircmd<\/a> from the site <a title=\"www.nirsoft.net\" href=\"http:\/\/www.nirsoft.net\" target=\"_blank\">www.nirsoft.net<\/a>. Make a folder on root of the c: drive called c:\\u\\nircmd and extract the nircmd files there.<\/p>\n<p>3. Open notepad and copy the the batch file commands above into it and modify the sound devices names as stated in item 1. Save the file C:\\U\\ChangeDisplay.cmd<\/p>\n<p>The command DisplaySwitch.exe is built into Windows 7.<\/p>\n<p>Now you can just run the command C:\\U\\ChangeDisplay.cmd to enable and disable HDMI Video and Sound.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently was involved in getting a friend with nice big flat panel TV who wanted to display his computer on TV in a simple way The way you normally do it is manually enable both the video for HDMI &hellip; <a href=\"https:\/\/www.geekythings.me\/?p=158\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,8],"tags":[],"class_list":["post-158","post","type-post","status-publish","format-standard","hentry","category-cool-gadgets","category-scripting"],"_links":{"self":[{"href":"https:\/\/www.geekythings.me\/index.php?rest_route=\/wp\/v2\/posts\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.geekythings.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.geekythings.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.geekythings.me\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.geekythings.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=158"}],"version-history":[{"count":10,"href":"https:\/\/www.geekythings.me\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions"}],"predecessor-version":[{"id":170,"href":"https:\/\/www.geekythings.me\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions\/170"}],"wp:attachment":[{"href":"https:\/\/www.geekythings.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.geekythings.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.geekythings.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}