Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Win 10 virtual desktops and DESKTOP

Oct
364
17
I have a set of programs I need to open for some genealogy activities. I can open them with a .btm that is basically this:

start /pgm "Wordprocessor.exe"
Delay 3
start /pgm "PDF Editor.exe"
Delay 3
start /pgm "Graphics Editor.exe"
Delay 3
start /pgm "Text Editor.exe"
Delay 3
start /pgm "File Manager.exe"
Delay 3

Text
Loaded the following:
(list)
EndText

I have this working, but I'm trying to load different programs into different Win 10 virtual desktops--some in Desktop 1 and some in Desktop 2.

I've tried /DESKTOP 1 and /DESKTOP=1 and neither works. I see there is a DESKTOP command but that seems unrelated to Win 10's virtual desktops.

Can TCC access or do any manipulation of Win 10 virtual desktops (e.g., switch between)? I would basically be interested in simply opening particular programs in particular Win 10 virtual desktops. But I can see that users might want to be able to switch between Win 10 virtual desktops.

I'm using TCC 18 on Win 10 Pro x64.
 
Incidentally, I checked and it appears currently there is no way to name Win 10 virtual desktops. They can only be Desktop 1, Desktop 2, etc. There are some workarounds, but nothing official.
 
I'm pretty sure that's what the DESKTOP command is for. START should launch the program on whatever desktop is currently visible, so something like:

Code:
desktop /c Word Processor
delay 3
start /pgm "Wordprocessor.exe"

desktop /c PDF Editor
delay 3
start /pgm "PDF Editor.exe"

desktop /c Graphics Editor
delay 3
start /pgm "Graphics Editor.exe"

desktop /c Text Editor
delay 3
start /pgm "Text Editor.exe"

and so on.
Code:
desktop default
at the end to get back to the original desktop, if you wish.

(On some versions of Windows, you may need to do this from a non-elevated TCC. There appears to be some API flakiness that I never fully understood.)
 
I tried it and it does work--but it definitely doesn't use the Win 10 desktops. Using TCC 22 at work running Win 7 Pro 32-bit I was able to create and switch between desktops. (Actually -- using Remote Desktop into Win 7.) Also, Win 10 desktops can't be assigned a name, only a number.

A similar TCC command I found is WINSTATION.

Problems I see are that it seems there is no way to delete a created desktops, and no way to identify which one you're in. If you run the DESKTOP command without parameters it lists the desktops. But it lists them in the same order regardless of which desktop you're in. I didn't see something like %_desktop or a way to determine programmatically whether a particular desktop exists, e.g. IF NOT %@desktop[Word Processor] echo Wordprocessor Desktop not opened

Also, I rebooted (because I couldn't figure out how to delete my test desktop) and when it came back up the additional desktop didn't exist. (I'm sure that's Working As Designed.) I don't normally use Win 10 multiple desktops, but I think they're persistent across sessions, although I'm not sure.
 
At home I use TCC 18, which doesn't have the PSHELL command. (I don't normally do programming at home.)

Supposedly there are (or were) Powershell commands for creating a new Win 10 virtual desktop and switching between desktops. However, apparently MS either dropped support with build 1803 or at least changed the commands.

It's not worth my time to screw with it, but if anyone does have this need, check into finding current Powershell commands and using PSHELL.
 

Similar threads

Back
Top