Problem creating and switching to a DESKTOP

Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  26.00.29 x64   Windows 10 [Version 10.0.18362.720]

When I execute the Desktop command it returns;
Code:
e:\utils>desktop
sbox_alternate_desktop_local_winstation_0x2B6C
Default
Winlogon

When I execute the Desktop command with options;
Code:
desktop /c /n jlc1
it returns a message box
Code:
---------------------------
explorer.exe - Application Error
---------------------------
The application was unable to start correctly (0xc0000142). Click OK to close the application.
---------------------------
OK  
---------------------------

I click OK, and I'm back at the TCC Prompt.

So, I create a new desktop via Windows 10
1587158703209.png


However, when I run Desktop to switch to "Desktop 2", I get
Code:
desktop "Desktop 2"
TCC: (Sys) The system cannot find the file specified.
 "Desktop 2"

Executing Desktop returns;
Code:
sbox_alternate_desktop_local_winstation_0x2B6C
Default
Winlogon
but does not list the "Desktop 2" that I created with Windows 10.

I have no problem to switch among the Desktops using the Win+Tab key, and then selecting the Desktop from that screen.

Joe
 
May 20, 2008
11,380
98
Syracuse, NY, USA
DESKTOP gives me

Code:
v:\> desktop
sbox_alternate_desktop_local_winstation_0xE5C
Default

"DESKTOP /C new_desktop" takes me to a new desktop which is nearly totally unfunctional. The start button doesn't work. Neither does Win+Tab (task view, so I can get back to the original desktop). Neither does Win+R. I had to C-A-D logoff. It seems like a real mess!

Alternative desktops work fine if I use the Windows built-in mechanisms.
 
May 20, 2008
11,380
98
Syracuse, NY, USA
FWIW, the string "sbox_alternate_desktop_" can be found in firefox.exe and (firefox's) plugin-container.exe.
 

rconn

Administrator
Staff member
May 14, 2008
12,340
149
DESKTOP gives me

Code:
v:\> desktop
sbox_alternate_desktop_local_winstation_0xE5C
Default

"DESKTOP /C new_desktop" takes me to a new desktop which is nearly totally unfunctional. The start button doesn't work. Neither does Win+Tab (task view, so I can get back to the original desktop). Neither does Win+R. I had to C-A-D logoff. It seems like a real mess!

Alternative desktops work fine if I use the Windows built-in mechanisms.

Why didn't you use DESKTOP to switch batch to your original desktop?
 
Here's a C# program with source code, which creates VirtualDesktop.exe, which allows working with Virtual Desktops from the command line.

Examples:
Code:
Virtualdesktop.exe -New -Switch -GetCurrentDesktop
Virtualdesktop.exe sleep:200 gd:1 mw:notepad s
Virtualdesktop.exe /Count /continue /Remove /Remove /Count
VirtualDesktop.exe -IsWindowPinned:cmd
if ERRORLEVEL 1 VirtualDesktop.exe PinWindow:cmd

Ref: MScholtes/VirtualDesktop

Joe
 
Here's a PowerShell solution with source for working with Virtual Desktops.

Examples:
Code:
# Load commands (assumes VirtualDesktop.ps1 is in the current path) 
. .\VirtualDesktop.ps1 
 
# Create a new virtual desktop and switch to it 
New-Desktop | Switch-Desktop 
 
# Get second virtual desktop (count starts with 0) and remove it 
Get-Desktop 1 | Remove-Desktop 
 
# Retrieves the count of virtual desktops 
Get-DesktopCount 
 
# Move notepad window to current virtual desktop 
(ps notepad)[0].MainWindowHandle | Move-Window (Get-CurrentDesktop) | Out-Null 
 
# Move powershell window to last virtual desktop and switch to it 
Get-Desktop ((Get-DesktopCount)-1) | Move-Window (Get-ConsoleHandle) | Switch-Desktop 
 
# Retrieve virtual desktop on which notepad runs and switch to it 
Get-DesktopFromWindow ((Get-Process "notepad")[0].MainWindowHandle) | Switch-Desktop 
 
# Pin notepad to all desktops 
Pin-Window ((Get-Process "notepad")[0].MainWindowHandle)

Ref: TechNet Powershell commands to manage virtual desktops of Windows 10

Joe
 

rconn

Administrator
Staff member
May 14, 2008
12,340
149
Windows 10 Virtual Desktops have nothing in common with the DESKTOP command, which uses a different (10-year-old) technology intended for Windows 7. (DESKTOP was introduced in Take Command v14.)

At this point, the internal DESKTOP command is deprecated for Win 10, and will either be removed or rewritten to support the new Windows 10 Virtual Desktops.
 
At this point, the internal DESKTOP command is deprecated for Win 10, and will either be removed or rewritten to support the new Windows 10 Virtual Desktops.

This is from the README.md of the C# program that I noted in post #5:
With Windows 10 1809 Microsoft changed the API (COM GUIDs) for accessing the functions for virtual desktops again.

I provide three versions of virtualdesktop.cs now:

virtualdesktop.cs is for Windows 10 1809 and newer,
virtualdesktop1803.cs is for Windows 10 1803,
virtualdesktop1607.cs is for Windows 10 1607 to 1709 and Windows Server 2016.

Does Take Command support all versions of Windows 10, back to 1507?

Ref: Windows 10 version history - Wikipedia

Joe
 

rconn

Administrator
Staff member
May 14, 2008
12,340
149
Take Command supports all version of Windows 10.

TCC doesn't support the virtual desktops because Microsoft has declined to document the necessary api's. They only documented one top-level COM interface that can only move a window to a desktop or tell which desktop the window is on.

Microsoft did add support for .NET apps to access most of the virtual desktop functionality, but everybody else is out of luck. And as long as they keep changing it, they're unlikely to document it.
 
Similar threads
Thread starter Title Forum Replies Date
Dick Johnson Weird Color Problem Support 8
fishman@panix.com Problem with 27.15 Support 2
M Problem with VSDevCmd.bat in VS 16.7.3 Support 0
R Problem with @INT[ value] in V26 Support 9
M Selecting test "off by one" problem in Take command Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
K_Meinhard Small problem in german IDE 26 Support 3
B Problem with color in nested shells Support 1
vefatica Another popup problem Support 10
Alpengreis ffind dialog (/W) problem Support 4
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
A Problem with functions @int @decimal and identifying Powershell as a shell. Support 12
B IF command problem in tcexit.btm Support 9
fishman@panix.com Problem at Startup of TCC Support 3
P Problem with SFTP copies Support 7
P Problem with FTP copies Support 10
Jay Sage Problem with Context Menu Copy+Paste+Run Key Assignment Support 7
R Problem with %_do_loop in nested do loops Support 2
fishman@panix.com New Problem with later Windows 10 Support 10
Peter Murschall A little problem with LEAVE and COMMENT Support 5
M Handling of %~I problem Support 4
WinLanEm FOR problem Support 18
K Problem With SCRPUT /u Support 3
vefatica What's TCMD's problem with ^e[0m? Support 13
Peter Murschall IDE: RTL with non-English resources-problem is back in Build 28 Support 4
rps Regex problem: \xnn not recognized as a hex character Support 0
rps PRIORITY LOW problem Support 1
old coot Regex problem: \xnn not recognized as a hex character Support 12
vefatica Another problem with build 22. Support 3
Alpengreis [23.x] Download-Problem Support 2
S Problem with " Support 3
C Problem navigating forums Support 11
x13 Problem listing repository files using DIR http(s)://... Support 8
Joe Caverly Problem with TEE in v22 Support 2
Alpengreis Problem with thousands delimiter and colors Support 17
M Take Command 18, migrating to another machine, license problem. Support 1
B TCC 21.01.50 Problem with ALIAS /r and SET /r Support 2
rps How to? @search problem Support 2
WinLanEm @SELECT problem Support 6
T Fixed Problem with use of Batch parameters in the IDE Support 1
Oz Solomon Problem with "list" Support 14
S V21.24 theme problem Support 2
Alpengreis Problem if command prompt is not legacy Support 4
Alpengreis TCMD.INI: The "super hidden" problem ... Support 6
G Odd problem - screen brightness Support 4
rps V20 In-process pipes problem Support 8
Alpengreis Again theme problem [v20.0.21]? Support 11
WinLanEm INPUT problem Support 1
Craig Fitzgerald problem with executable extensons with TCC version 19.10.51 x64 Support 3

Similar threads