PDC. - Private Desktop Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > PDC. - Private Desktop Commands >

PDC. - Private Desktop Commands

PDC. - General Usage

Previous Top Next


MiniRobotLanguage (MRL)

 

 

PDC. - Manage private Desktops

Used to start the Automation on a private Desktop (Hidden Desktop)

 

 

Intention

 

Generally the PDC. - command is used to manage the "Private Desktops" from Script.
You can add or remove "Private Desktops". You can switch to - or from a "Private Desktop".

 

Using PDC. The SPR can do some things with PD's, these are:

1. Create PD's

2. Destroy PD's

3. Switch between PD's

4. Run Programs or Scripts on any PD, also with "Run as User"

5. Check if a PD exists or not

 

The SPR can NOT work itself on PD's. It will always stay with the desktop where it was run. This is due to Limitiations in windows.

To do this you will need to start a dedicated SPR on this PD using:
 
PDC.Run on Desktop WFI|PD Name|compiled Script.exe

 

Aside of the PDC. - Command, you have the new '#HID: Compiler Directive to start compiled executables on the private Desktop. Also the Command PRR. - Parallel-Robot-Run has been enhanced to start Scripts on PD's.

 

Even if you Switch to a PD, all Robot-Commands will be executed on the Desktop where the Robot was originally started.

 

Do i have "Private Desktops"?

If you have created private Desktops, these will be displayed in the SPR-Editor, in the "Desktops-Inspector". In this Example, you can see a "private Desktop" named "Desktop-1".

 

The Desktop with the name "Default" is always the "Normal User Desktop".

Its the Desktop which Windows will give you when it starts.

Its the Desktop where you work normally and where everything works as expected.

 

 

Desktops-Inspector

 

The SPR-Editor shows a new private Desktop with the name "Desktop-1".

 

 

What are "private Desktops" good for?

You can run Scripts on "private Desktops". These Scripts can use the Mouse-Pointer.

And while these Scripts run, you - or an other User - can still work and use the Computer.

 

What is the difference to "Windows virtual Desktops" ?

Theoretically you can also use "private Desktops" like the new "virtual Desktops" that are built into Windows 10. But for this we recommend to prefer the Windows 10 Desktops, as you can move Windows

from one "virtual Desktop" to another. This is not possible with "Real Desktops".

Therefore for human use the "virtual Desktops" may be best.

 

Win10-VD2Won10-VD1

Virtual Desktops are built into Windows 10. These are NOT the Desktops we use for the SPR.

 

On the other side, these "virtual Desktops" do not support running independent Scripts.

You can not run a Script that uses the Mouse on such a "virtual Desktop".
It will not work due to the nature of these "virtual Desktops".

 

Do NOT intermix our "Real Private Desktops" with these "virtual Desktops".

These are more like "Desktop simulations". As said, the reason is that you can move windows

from one Desktop to another. This is not possible with "Private Desktops".

They are technically separated from each other.

Private Desktops have an own Mousepointer and own "Input Focus".

 

How can i manage "private Desktops" aside from Scripts?

To take a look on an private Desktop - for example to check for error-Messages - as well, as to Switch back from an "private Desktop" to the "Default Desktop",

    you may need to use the "Switch Desktop"-Tool that is provided together with this SPR-Release.

 

Desktop-Switch

 

You will find the Tool "Desktop-Switcher.exe" in the Startmenu.

 

Des_manag

Also you will find the Tool "Desktops Manager.exe" in the Startmenu.

 

Both Tools provide you with the ability to manage "private Desktops".

For example you can

- add a private Desktop,

- or remove a private Desktop.
You can also start an Executable "on a private Desktop".

 

Here is an Sample-Script that will switch to a private Desktop and then after 5 Seconds switch back to the "Default Desktop".

 

PDC.Create Desktop with Explorer|Desktop-1

PDC.Switch to Desktop|Desktop-1

PAU.5

PDC.Goto Default

ENR.

 

 

   Important: You may not always be able to delete a private Desktop after Usage.

                    The "Private Desktop" will be gone after the next reboot.

 

 

  Windows itself provides two Standard-Desktops, these are:
 
Default

Winlogon

 

    neither of these can be closed.

 

   Additional to the PDC-Commands there are two Query-Commands:

  ICD./NCD. - If/Not Current Desktop

  IPD./NPD. - If/Not Private Desktop

 

 

Syntax:

 

PDC.P1[|P2][|P3]

 

 

Parameter Explanation:

 

P1 - Subcommand, this can be any of the following:

     "create desktop with explorer","cde"

     "create desktop no explorer","cdn"

     "switch to desktop","swd"

     "set user","su"

     "reset user","ru"

     "run on desktop wfi","ruda"

     "run on desktop wfo","rudb"

     "close desktop","cld"

     "get current desktop name","gdn"

     "goto default","gd"
 

The Abbreviations like "gd" for "Goto Default" are functionally equal to the original command.

 

 
P2 -  ...

 

 

 

Example:

 

 

'----------------------------------------

' This script will create a PD

' and destroy it later

'----------------------------------------

'

VAR.$$PRO=?progs\Smart Package Robot\Desktops_Manager.exe

PDC.Create Desktop with Explorer|DTA

PDC.Run on Desktop WFI|DTA|$$PRO

PDC.Switch to Desktop|DTA

' The following Bubble-Text appears on the original Desktop

SBT.Waiting a bit ...|FS:24 CS:1 T:15

PAU.5

PDC.Goto Default

PAU.10

' Close PD

PDC.Close Desktop|DTA

MBX.!

ENR.

 

 

'----------------------------------------

' Create Desktop / Switch to Desktop

'----------------------------------------

PDC.Create Desktop with Explorer|Desktop-1

PDC.Switch to Desktop|Desktop-1

PAU.5

PDC.Goto Default

ENR.

 

 

 

'----------------------------------------

' Compile-Time Commands

'----------------------------------------

'

' The following line will make the compiled

' executable start up on the private Desktop "Desktop-2".

' It will only work if the Script has full admin-rights.

' The command will switch to the private Desktop.
' After you click the Messagebox, the private Desktop will be removed.

'

'#HID:2|scn

'

MBX.I am the Smart Package Robot on Desk 2!

END.

 

 

Remarks:

 

'#HID: does work with '#RAU:.

 

This feature is currently experimental, therefore not all features of the SPR and the SPR-Editor may work as expected on private Desktops.
To start SPR Scripts on a private Desktop, the Executable needs Admin-Rights.

 

 

Limitations:

 

    This Feature may require Windows Vista or higher.

    This feature needs Admin-Rights!

This feature is currently a bit experimental, therefore not all features of the SPR and the SPR-Editor may work as expected on private Desktops.

For Limitations in the Windows-Explorer itself, not all Actions will be possible on "private Desktops".
Sometimes System-Windows - like the Start-Menu - will not open on the "private Desktop" but on the Default Desktop.

 

 

DANGER: Using the "Close Desktop"-Option will forcefully terminate all processes that are bound to the Desktop that is to be closed!
 
Also note:  Before the new created Desktop can be closed, the Script switches to the new Desktop.

When the new Desktop has been closed, the Script switches to the Default desktop.

 

 

See also:

 

    PRR. - Parallel-Robot-Run

    2.1.5 '#HID: - Hidden Desktop Scripts

  ICD./NCD. - If/Not Current Desktop

  IPD./NPD. - If/Not Private Desktop

  PDC.Close Desktop

  PDC.Create Desktop no Explorer

  PDC.Create Desktop with Explorer

  PDC.Get current Desktop Name

  PDC.Goto Default

  PDC.Run on Desktop WFI/WFO

  PDC.Set User / Reset User

  PDC.Switch to Desktop

    EXV. - Execute via System

    2.1.4 '#EXV: - Execute on System Desktop

    HDC. - Hidden Desktop Control

    '#RAU: Run as User    

    #ONCE / # OEND - Multiple Include Protection

    2.1.8 '#INC: - Include Files and Folders into the Executable