{"id":27861191,"url":"https://github.com/mscholtes/virtualdesktop","last_synced_at":"2025-05-15T16:04:38.286Z","repository":{"id":46289918,"uuid":"90637479","full_name":"MScholtes/VirtualDesktop","owner":"MScholtes","description":"C# command line tool to manage virtual desktops in Windows 10","archived":false,"fork":false,"pushed_at":"2025-03-14T14:07:33.000Z","size":507,"stargazers_count":656,"open_issues_count":1,"forks_count":69,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-05-04T18:49:31.009Z","etag":null,"topics":["virtual-desktop","virtualdesktop","windows"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MScholtes.png","metadata":{"files":{"readme":"README.md","changelog":"Changes.txt","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-08T14:27:30.000Z","updated_at":"2025-05-03T21:04:11.000Z","dependencies_parsed_at":"2024-01-29T15:45:22.204Z","dependency_job_id":"71b60a3f-3120-4721-b9ef-9bdc1fa2d239","html_url":"https://github.com/MScholtes/VirtualDesktop","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MScholtes%2FVirtualDesktop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MScholtes%2FVirtualDesktop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MScholtes%2FVirtualDesktop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MScholtes%2FVirtualDesktop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MScholtes","download_url":"https://codeload.github.com/MScholtes/VirtualDesktop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374409,"owners_count":22060610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["virtual-desktop","virtualdesktop","windows"],"created_at":"2025-05-04T18:33:07.069Z","updated_at":"2025-05-15T16:04:38.268Z","avatar_url":"https://github.com/MScholtes.png","language":"C#","readme":"# VirtualDesktop\nC# command line tool to manage virtual desktops in Windows 10 and Windows 11\n\n**Pre-compiled binaries in Releases**\n\n**Version 1.20, 2025-01-18**\n- new parameters /PinActiveWindow and /UnPinActiveWindow \n- Windows 11: new parameter /Amimation to enable or disable animated desktop switches\n- nicer icon :-)\n- window handles can be negative\n\n(look for a powershell version here: https://github.com/MScholtes/PSVirtualDesktop or here: https://www.powershellgallery.com/packages/VirtualDesktop)\n\n**With Windows 11 23H2 Release 3085 Microsoft did change the API (COM GUIDs) for accessing the functions for virtual desktops again. I provide five versions of virtualdesktop.cs now: virtualdesktop.cs is for Windows 10, virtualdesktop11.cs is for Windows 11, virtualdesktop11-24h2.cs for Windows 11 24H2, virtualdesktopserver2022.cs is for Windows Server 2022, virtualdesktopserver2016.cs is for Windows Server 2016. Using Compile.bat all executables will be generated.**\n\n## Generate:\nCompile with Compile.bat (no visual studio needed, but obviously Windows 10 or 11)\n\n## Description:\nCommand line tool to manage the virtual desktops of Windows 10 and 11.\nParameters can be given as a sequence of commands. The result - most of the times the number of the processed desktop - can be used as input for the next parameter. The result of the last command is returned as error level.\nVirtual desktop numbers start with 0.\n\n## Parameters (leading / can be omitted or - can be used instead):\n**/Help /h /?**      this help screen.\n\n**/Verbose /Quiet**  enable verbose (default) or quiet mode (short: /v and /q).\n\n**/Break /Continue** break (default) or continue on error (short: /b and /co).\n\n**/Animation:\u0026lt;s\u0026gt;**   Enable switch animations (default) with 'On' or '1' and disable switch animations with 'Off' or '0' (short: /anim)(only VirtualDesktop11.exe).\n\n**/List**            list all virtual desktops (short: /li).\n\n**/Count**           get count of virtual desktops to pipeline (short: /c).\n\n**/GetDesktop:\u0026lt;n|s\u0026gt;**  get number of virtual desktop \u0026lt;n\u0026gt; or desktop with text \u0026lt;s\u0026gt; in name to pipeline (short: /gd).\n\n**/GetCurrentDesktop**  get number of current desktop to pipeline (short: /gcd).\n\n**/Name[:\u0026lt;s\u0026gt;]**      set name of desktop with number in pipeline (short: /na).\n\n**/Wallpaper[:\u0026lt;s\u0026gt;]**  set wallpaper path of desktop with number in pipeline (short: /wp)(only VirtualDesktop11.exe).\n\n**/AllWallpapers:\u0026lt;s\u0026gt;**  set wallpaper path of all desktops (short: /awp)(only VirtualDesktop11.exe).\n\n**/IsVisible[:\u0026lt;n|s\u0026gt;]**  is desktop number \u0026lt;n\u0026gt;, desktop with text \u0026lt;s\u0026gt; in name or number in pipeline visible (short: /iv)? Returns 0 for visible and 1 for invisible.\n\n**/Switch[:\u0026lt;n|s\u0026gt;]**    switch to desktop with number \u0026lt;n\u0026gt;, desktop with text \u0026lt;s\u0026gt; in name or with number in pipeline (short: /s).\n\n**/Left**            switch to virtual desktop to the left of the active desktop (short: /l).\n\n**/Right**           switch to virtual desktop to the right of the active desktop (short: /ri).\n\n**/Wrap /NoWrap**    /Left or /Right switch over or generate an error when the edge is reached (default)(short /w and /nw).\n\n**/New**             create new desktop (short: /n). Number is stored in pipeline.\n\n**/Remove[:\u0026lt;n|s\u0026gt;]**    remove desktop number \u0026lt;n\u0026gt;, desktop with text \u0026lt;s\u0026gt; in name or desktop with number in pipeline (short: /r).\n\n**/RemoveAll**       remove all desktops but visible (short: /ra).\n\n**/SwapDesktop:\u0026lt;n|s\u0026gt;**  swap desktop in pipeline with desktop number \u0026lt;n\u0026gt;, desktop with text \u0026lt;s\u0026gt; in name or desktop with number in pipeline (short: /sd).\n\n**/InsertDesktop:\u0026lt;n|s\u0026gt;**  insert desktop number \u0026lt;n\u0026gt; or desktop with text \u0026lt;s\u0026gt; in name before desktop in pipeline or vice versa (short: /id)(not VirtualDesktop11.exe).\n\n**/MoveDesktop:\u0026lt;n|s\u0026gt;**  move desktop in pipeline to desktop number \u0026lt;n\u0026gt; or desktop with text \u0026lt;s\u0026gt; in name (short: /md)(only VirtualDesktop11.exe).\n\n**/MoveWindowsToDesktop::\u0026lt;n|s\u0026gt;**  move windows on desktop in pipeline to desktop number \u0026lt;n\u0026gt; or desktop with text \u0026lt;s\u0026gt; in name (short: /mwtd).\n\n**/MoveWindow:\u0026lt;s|n\u0026gt;**  move process with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; to desktop with number in pipeline (short: /mw).\n\n**/MoveWindowHandle:\u0026lt;s|n\u0026gt;**  move window with text \u0026lt;s\u0026gt; in title or handle \u0026lt;n\u0026gt; to desktop with number in pipeline (short: /mwh).\n\n**/MoveActiveWindow**  move active window to desktop with number in pipeline (short: /maw).\n\n**/GetDesktopFromWindow:\u0026lt;s|n\u0026gt;**  get desktop number where process with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; is displayed (short: /gdfw).\n\n**/GetDesktopFromWindowHandle:\u0026lt;s|n\u0026gt;**  get desktop number where window with text \u0026lt;s\u0026gt; in title or handle \u0026lt;n\u0026gt; is displayed (short: /gdfwh).\n\n**/IsWindowOnDesktop:\u0026lt;s|n\u0026gt;**  check if process with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; is on desktop with number in pipeline (short: /iwod). Returns 0 for yes, 1 for no.\n\n**/IsWindowHandleOnDesktop:\u0026lt;s|n\u0026gt;**  check if window with text \u0026lt;s\u0026gt; in title or handle \u0026lt;n\u0026gt; is on desktop with number in pipeline (short: /iwhod). Returns 0 for yes, 1 for no.\n\n**/ListWindowsOnDesktop[:\u0026lt;n|s\u0026gt;]**  list handles of windows on desktop number \u0026lt;n\u0026gt;, desktop with text \u0026lt;s\u0026gt; in name or desktop with number in pipeline (short: /lwod).\n\n**/CloseWindowsOnDesktop[:\u0026lt;n|s\u0026gt;]**  close windows on desktop number \u0026lt;n\u0026gt;, desktop with text \u0026lt;n\u0026gt; in name or desktop with number in pipeline (short: /cwod).\n\n**/PinWindow:\u0026lt;s|n\u0026gt;**   pin process with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; to all desktops (short: /pw).\n\n**/PinActiveWindow**  pin active window to all desktops (short: /paw).\n\n**/PinWindowHandle:\u0026lt;s|n\u0026gt;**   pin window with text \u0026lt;s\u0026gt; in title or handle \u0026lt;n\u0026gt; to all desktops (short: /pwh).\n\n**/UnPinWindow:\u0026lt;s|n\u0026gt;**  unpin process with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; from all desktops (short: /upw).\n\n**/UnPinActiveWindow**  unpin active window from all desktops (short: /upaw).\n\n**/UnPinWindowHandle:\u0026lt;s|n\u0026gt;**  unpin window with text \u0026lt;s\u0026gt; in title or handle \u0026lt;n\u0026gt; from all desktops (short: /upwh).\n\n**/IsWindowPinned:\u0026lt;s|n\u0026gt;**  check if process with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; is pinned to all desktops (short: /iwp). Returns 0 for yes, 1 for no.\n\n**/IsWindowHandlePinned:\u0026lt;s|n\u0026gt;**  check if window with text \u0026lt;s\u0026gt; in title or handle \u0026lt;n\u0026gt; is pinned to all desktops (short: /iwhp). Returns 0 for yes, 1 for no.\n\n**/PinApplication:\u0026lt;s|n\u0026gt;**  pin application with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; to all desktops (short: /pa).\n\n**/UnPinApplication:\u0026lt;s|n\u0026gt;**  unpin application with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; from all desktops (short: /upa).\n\n**/IsApplicationPinned:\u0026lt;s|n\u0026gt;**  check if application with name \u0026lt;s\u0026gt; or id \u0026lt;n\u0026gt; is pinned to all desktops (short: /iap). Returns 0 for yes, 1 for no.\n\n**/Calc:\u0026lt;n\u0026gt;**        add \u0026lt;n\u0026gt; to result, negative values are allowed (short: /ca).\n\n**/WaitKey**       wait for key press (short: /wk).\n\n**/Sleep:\u0026lt;n\u0026gt;**     wait for \u0026lt;n\u0026gt; milliseconds (short: /sl).\n\n## Hints:\nInstead of a desktop name you can use LAST or \\*LAST\\* to select the last virtual desktop.\n\nInsert ^^ somewhere in window title parameters to prevent finding the own window. ^ is removed before searching window titles.\n\n## Examples:\n```bat\nVirtualdesktop.exe /LIST\n\nVirtualdesktop.exe \"-Switch:Desktop 2\"\n\nVirtualdesktop.exe -New -Switch -GetCurrentDesktop\n\nVirtualdesktop.exe Q N /MOVEACTIVEWINDOW /SWITCH\n\nVirtualdesktop.exe sleep:200 gd:1 mw:notepad s\n\nVirtualdesktop.exe /Count /continue /Remove /Remove /Count\n\nVirtualdesktop.exe /Count /Calc:-1 /Switch\n\nVirtualDesktop.exe -IsWindowPinned:cmd\nif ERRORLEVEL 1 VirtualDesktop.exe PinWindow:cmd\n\nVirtualdesktop.exe -GetDesktop:*last* \"-MoveWindowHandle:note^^pad\"\n\nfor /f \"tokens=4 delims= \" %i in ('VirtualDesktop.exe c') do @set DesktopCount=%i\necho Count of desktops is %DesktopCount%\nif %DesktopCount% GTR 1 VirtualDesktop.exe REMOVE\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscholtes%2Fvirtualdesktop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmscholtes%2Fvirtualdesktop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscholtes%2Fvirtualdesktop/lists"}