Shell application windows security

Содержание
  1. Security Considerations: Microsoft Windows Shell
  2. Installing Your Application Properly
  3. Shlwapi
  4. Autocomplete
  5. ShellExecute, ShellExecuteEx, and Related Functions
  6. Moving and Copying Files
  7. Writing Secure Namespace Extensions
  8. Security Alerts
  9. Use Shell Launcher to create a Windows 10 kiosk
  10. Differences between Shell Launcher v1 and Shell Launcher v2
  11. Requirements
  12. Enable Shell Launcher feature
  13. Configure a custom shell in MDM
  14. XML for Shell Launcher configuration
  15. Custom OMA-URI setting
  16. Configure a custom shell using PowerShell
  17. default action, custom action, exit code
  18. Объект Shell
  19. 1. Создание объекта
  20. 2. Свойства
  21. 2.1. Application
  22. 2.2. Parent
  23. 3. Методы
  24. 3.1. MinimizeAll
  25. 3.2. UndoMinimizeAll
  26. 3.3. TileHorizontally
  27. 3.4. TileVertically
  28. 3.5. CascadeWindows
  29. 3.6. Explore
  30. 3.7. Open
  31. 3.8. NameSpace
  32. 3.9. FileRun
  33. 3.10. FindComputer
  34. 3.11. FindFiles
  35. 3.12. FindPrinter
  36. 3.13. Help
  37. 3.14. ShutdownWindows
  38. 3.15. SetTime
  39. 3.16. TrayProperties
  40. 3.17. ControlPanelItem
  41. 3.18. BrowseForFolder
  42. 3.19. Windows
  43. 3.20. CanStartStopService
  44. 3.21. IsServiceRunning
  45. 3.22. ServiceStart
  46. 3.23. ServiceStop
  47. 3.24. GetSystemInformation
  48. 3.25. IsRestricted
  49. 3.26. ShellExecute
  50. 3.27. ShowBrowserBar
  51. 3.28. AddToRecent
  52. 3.29. ExplorerPolicy
  53. 3.30. GetSetting
  54. 3.31. ToggleDesktop
  55. 3.32. WindowsSecurity
  56. 4. Объект Folder
  57. 4.1. Создание объекта
  58. 4.2. Свойства
  59. 4.2.1. Title
  60. 4.2.2. Self
  61. 4.2.3. ParentFolder
  62. 4.2.4. Application
  63. 4.2.5. OfflineStatus
  64. 4.3. Методы
  65. 4.3.1. NewFolder
  66. 4.3.2. CopyHere
  67. 4.3.3. MoveHere
  68. 4.3.4. Items
  69. 4.3.5. ParseName
  70. 4.3.6. GetDetailsOf
  71. 4.3.7. DismissedWebViewBarricade
  72. 4.3.8. Synchronize
  73. 5. Объект FolderItems
  74. 5.1. Создание объекта
  75. 5.2. Свойства
  76. 5.2.1. Application
  77. 5.2.2. Count
  78. 5.2.3. Verbs
  79. 5.3. Методы
  80. 5.3.1. Item
  81. 5.3.2. InvokeVerbEx
  82. 5.3.3. Filter

Security Considerations: Microsoft Windows Shell

This topic provides information about security considerations related to the Windows Shell. This document cannot provide all you need to know about security issues—instead, use it as a starting point and reference for this specific technology area.

The Shell controls a number of important aspects of the system, including several that present potential security risks if they are not properly handled. This topic outlines some of the more common issues and how to address them in your applications. Remember that security is not limited to Internet-based exploits. On shared systems, including systems that are accessible through Terminal Services, you must also ensure that users cannot do anything that could harm others who share the system.

Installing Your Application Properly

The majority of potential Shell security issues can be mitigated by correctly installing your application.

Install the application under the Program Files folder.

Operating System Location
WindowsВ XP, Windows ServerВ 2003, and earlier CSIDL_PROGRAM_FILES
WindowsВ Vista and later FOLDERID_ProgramFiles, FOLDERID_ProgramFilesX86, FOLDERID_ProgramFilesX64, FOLDERID_ProgramFilesCommon, FOLDERID_ProgramFilesCommonX86, or FOLDERID_ProgramFilesCommonX64. See KNOWNFOLDERID for specifics.

Do not store user data under the Program Files folder.

Use the appropriate data folder for data that is common to all users.

Operating System Location
WindowsВ XP, Windows ServerВ 2003, and earlier CSIDL_COMMON_APPDATA
WindowsВ Vista and later FOLDERID_ProgramData

Use the appropriate user data folder for data that belongs to a particular user.

Operating System Location
WindowsВ XP, Windows ServerВ 2003, and earlier CSIDL_APPDATA, CSIDL_PERSONAL, and others.
WindowsВ Vista and later FOLDERID_RoamingAppData, FOLDERID_Documents, and others.

If you must install to a location other than the Program Files folder, make sure that you set access control lists (ACLs) properly so that users do not have access to inappropriate parts of the file system. Any data that is specific to a particular user should have an ACL that prevents any other user from accessing it.

When you set up file associations, be sure to properly specify the command line. Use a fully qualified path and wrap any elements that contain white space in quotation marks. Wrap command parameters in separate quotation marks. Otherwise, the string might be incorrectly parsed and the application will not launch properly. Two examples of properly formed command lines are shown here.

The location of the standard installation folders might vary from system to system. To get the location of a standard folder on a particular WindowsВ Vista or later system, call SHGetKnownFolderPath with the appropriate KNOWNFOLDERID value. In WindowsВ XP, Windows ServerВ 2003, or earlier systems, call SHGetFolderLocation or SHGetFolderPath with the appropriate CSIDL value.

Shlwapi

The Shell Lightweight API (Shlwapi) includes a number of string manipulation functions. Using these functions incorrectly can lead to unexpectedly truncated strings with no notification of the truncation being returned. In the following cases, the Shlwapi functions should not be used. The listed alternative functions, which pose fewer risks, should be used in their place.

Shlwapi Function Alternative Function
StrCat,StrNCat StringCchCat, StringCbCat and related functions
StrCpy, StrCpyN StringCchCopy, StringCbCopy and related functions
wnsprintf, wvnsprintf StringCchPrintf, StringCbPrintf and related functions

With functions such as PathRelativePathTo that return a file path, always set the size of the buffer to MAX_PATH characters. Doing so ensures that the buffer is large enough to hold the largest possible file path, plus a terminating null character.

For more information on the alternative string functions, see About Strsafe.h.

Autocomplete

Do not use the Autocomplete feature for passwords.

There are several Shell functions that you can use to launch applications: ShellExecute, ShellExecuteEx, WinExec, and SHCreateProcessAsUserW. Make sure you provide an unambiguous definition of the application that is to be executed.

  • When providing the executable file’s path, provide the fully qualified path. Do not depend on the Shell to locate the file.
  • If you provide a command-line string that contains white space, wrap the string in quotation marks. Otherwise, the parser might interpret a single element that contains spaces as multiple elements.

Moving and Copying Files

One key to system security is properly assigning ACLs. You also might use encrypted files. Make sure that when you move or copy files, that they are assigned the correct ACL and that they have not been accidentally decrypted. This includes moving files to the Recycle Bin, as well as within the file system. Use IFileOperation (WindowsВ Vista or later) or SHFileOperation (WindowsВ XP and earlier). Do not use MoveFile, which might not set the expected ACL for the destination file.

Writing Secure Namespace Extensions

Shell namespace extensions are a powerful and flexible way to present data to the user. However, they can cause system failure if they are not correctly written. Some key points to keep in mind:

  • Do not assume that data such as images are formatted correctly.
  • Do not assume that MAX_PATH is equivalent to the number of bytes in a string. It is the number of characters.

Security Alerts

The following table lists some features that can, if used incorrectly, compromise the security of your applications.

Use Shell Launcher to create a Windows 10 kiosk

Applies to

Using Shell Launcher, you can configure a device that runs an application as the user interface, replacing the default shell (explorer.exe). In Shell Launcher v1, available in Windows 10, you can only specify a Windows desktop application as the replacement shell. In Shell Launcher v2, available in Windows 10, version 1809 and above, you can also specify a UWP app as the replacement shell. To use Shell Launcher v2 in version 1809, you need to install the KB4551853 update.

Shell Launcher controls which application the user sees as the shell after sign-in. It does not prevent the user from accessing other desktop applications and system components.

Methods of controlling access to other desktop applications and system components can be used in addition to using the Shell Launcher. These methods include, but are not limited to:

  • Group Policy — example: Prevent access to registry editing tools
  • AppLocker — Application control policies
  • Mobile Device Management — Enterprise management of device security policies

You can apply a custom shell through Shell Launcher by using PowerShell. In Windows 10, version 1803 and later, you can also use mobile device management (MDM) to apply a custom shell through Shell Launcher.

Differences between Shell Launcher v1 and Shell Launcher v2

Shell Launcher v1 replaces explorer.exe , the default shell, with eshell.exe which can launch a Windows desktop application.

Shell Launcher v2 replaces explorer.exe with customshellhost.exe . This new executable file can launch a Windows desktop application or a UWP app.

In addition to allowing you to use a UWP app for your replacement shell, Shell Launcher v2 offers additional enhancements:

  • You can use a custom Windows desktop application that can then launch UWP apps, such as Settings and Touch Keyboard.
  • From a custom UWP shell, you can launch secondary views and run on multiple monitors.
  • The custom shell app runs in full screen, and can run other apps in full screen on user’s demand.

For sample XML configurations for the different app combinations, see Samples for Shell Launcher v2.

Requirements

Windows 10 doesn’t support setting a custom shell prior to OOBE. If you do, you won’t be able to deploy the resulting image.

Shell Launcher doesn’t support a custom shell with an application that launches a different process and exits. For example, you cannot specify write.exe in Shell Launcher. Shell Launcher launches a custom shell and monitors the process to identify when the custom shell exits. Write.exe creates a 32-bit wordpad.exe process and exits. Because Shell Launcher is not aware of the newly created wordpad.exe process, Shell Launcher will take action based on the exit code of Write.exe, such as restarting the custom shell.

A domain, Azure Active Directory, or local user account.

A Windows application that is installed for that account. The app can be your own company application or a common app like Internet Explorer.

Enable Shell Launcher feature

To set a custom shell, you first turn on the Shell Launcher feature, and then you can set your custom shell as the default using PowerShell or MDM.

To turn on Shell Launcher in Windows features

Go to Control Panel > Programs and features > Turn Windows features on or off.

Expand Device Lockdown.

Select Shell Launcher and OK.

Alternatively, you can turn on Shell Launcher using Windows Configuration Designer in a provisioning package, using SMISettings > ShellLauncher , or you can use the Deployment Image Servicing and Management (DISM.exe) tool.

To turn on Shell Launcher using DISM

Open a command prompt as an administrator.

Enter the following command.

Configure a custom shell in MDM

You can use XML and a custom OMA-URI setting to configure Shell Launcher in MDM.

XML for Shell Launcher configuration

The following XML sample works for Shell Launcher v1:

For Shell Launcher v2, you can use UWP app type for Shell by specifying the v2 namespace, and use v2:AppType to specify the type, as shown in the following example. If v2:AppType is not specified, it implies the shell is Win32 app.

In the XML for Shell Launcher v2, note the AllAppsFullScreen attribute. When set to True, Shell Launcher will run every app in full screen, or maximized for desktop apps. When this attribute is set to False or not set, only the custom shell app runs in full screen; other apps launched by the user will run in windowed mode.

Custom OMA-URI setting

In your MDM service, you can create a custom OMA-URI setting to configure Shell Launcher v1 or v2. (The XML that you use for your setting will determine whether you apply Shell Launcher v1 or v2.)

The OMA-URI path is ./Device/Vendor/MSFT/AssignedAccess/ShellLauncher .

For the value, you can select data type String and paste the desired configuration file content into the value box. If you wish to upload the xml instead of pasting the content, choose data type String (XML file) .

After you configure the profile containing the custom Shell Launcher setting, select All Devices or selected groups of devices to apply the profile to. Don’t assign the profile to users or user groups.

Configure a custom shell using PowerShell

For Shell Launcher v1, modify the following PowerShell script as appropriate. The comments in the sample script explain the purpose of each section and tell you where you will want to change the script for your purposes. Save your script with the extension .ps1, open Windows PowerShell as administrator, and run the script on the kiosk device.

default action, custom action, exit code

Shell launcher defines 4 actions to handle app exits, you can customize shell launcher and use these actions based on different exit code.

Value Description
0 Restart the shell
1 Restart the device
2 Shut down the device
3 Do nothing

These action can be used as default action, or can be mapped to a specific exit code. Refer to Shell Launcher to see how these codes with Shell Launcher WMI.

Объект Shell

1. Создание объекта

Не все объекты, их свойства и методы будут работать на всех версиях Windows. Подробности — см. MSDN (часто проще проверить работоспособность кода экспериментально). Устанавливайте обновления для Internet Explorer. Некоторые методы доступны или имеют смысл только в контексте HTML-документа.

При использовании свойств и методов объекта Shell, возвращающих агрегатные объекты, в VBScript желательно всегда обрабатывать исключения и проверять полученный объект на существование (сравнивать с Nothing). Объект типа «IShellDispatch» возвращается также в таких случаях:

2. Свойства

2.1. Application

Возвращаемое значение: объект «IShellDispatch».

Замечание: только чтение.

2.2. Parent

Возвращаемое значение: объект «IShellDispatch».

Замечание: только чтение.

3. Методы

3.1. MinimizeAll

Назначение: сворачивание всех окон рабочего стола Windows. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда «Показать рабочий стол» («Minimize All Windows») контекстного меню панели задач Windows или щелчок по значку «Свернуть все окна» («Show Desktop») на панели «Быстрый запуск» («Quick Launch») панели задач Windows.

3.2. UndoMinimizeAll

Назначение: восстановление всех свёрнутых окон рабочего стола Windows. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда «Отменить Свернуть все» («Undo Minimize All Windows») контекстного меню панели задач Windows или повторный щелчок по значку «Свернуть все окна» («Show Desktop») на панели «Быстрый запуск» («Quick Launch») панели задач Windows.

3.3. TileHorizontally

Назначение: упорядочение окон рабочего стола Windows по горизонтали. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда «Окна сверху вниз» («Tile Windows Horizontally») контекстного меню панели задач Windows.

3.4. TileVertically

Назначение: упорядочение окон рабочего стола Windows по вертикали. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда «Окна слева направо» («Tile Windows Vertically») контекстного меню панели задач Windows.

3.5. CascadeWindows

Назначение: расположение всех несвёрнутых окон рабочего стола Windows каскадом. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда «Окна каскадом» («Cascade Windows») контекстного меню панели задач Windows.

3.6. Explore

Назначение: запуск проводника Windows с определённой открытой папкой. Возвращаемого значения нет.

— путь к открываемой папке. Тип — строка.

может быть числом, определяющим одну из специальных папок Windows. Коды папок — см. описание метода «NameSpace».

3.7. Open

Назначение: запуск проводника Windows с определённой открытой папкой. Возвращаемого значения нет.

— путь к открываемой папке. Тип — строка.

может быть числом, определяющим одну из специальных папок Windows. Коды папок — см. описание метода «NameSpace».

3.8. NameSpace

Назначение: получение объекта виртуальной папки проводника. Возвращает объект «Folder».

— путь к папке или диску. Тип — строка.

может быть числом, определяющим одну из специальных папок Windows.

3.9. FileRun

Назначение: вызов окна «Запуск программы» («Run»). Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда меню «Пуск»-«Выполнить» («Start»-«Run»).

3.10. FindComputer

Назначение: вызов окна проводника Windows «Результаты поиска — компьютеры» («Search Results — Computers»). Возвращаемого значения нет.

3.11. FindFiles

Назначение: вызов окна проводника Windows «Результаты поиска» («Find: All Files»). Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда меню «Пуск»-«Поиск» («Start»-«Find»).

3.12. FindPrinter

Назначение: вызов окна «Поиск принтеров» («Find Printers») в Active Directory с предварительным заполнением параметров поиска. Возвращаемого значения нет.

  • — необязательный. Строка — имя принтера.
  • — необязательный. Строка — местоположение принтера.
  • — необязательный. Строка — модель принтера.

Описание: вызов метода приводит примерно к тому же эффекту, что и команда меню «Пуск»-«Поиск»-«Принтеры. » («Start»-«Search»-«For Printers. «) в Windows 2000.

Пример (Windows 2000 Server):

3.13. Help

Назначение: вызов справки Windows. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда меню «Пуск»-«Справка и поддержка» («Start»-«Help and Support»).

3.14. ShutdownWindows

Назначение: вызов окна выключения и перезагрузки компьютера. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда меню «Пуск»-«Завершение работы» («Start»-«Shut Down»).

3.15. SetTime

Назначение: вызов окна настройки времени и даты. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и двойной щелчок по часам в правой части панели задач Windows.

3.16. TrayProperties

Назначение: вызов окна свойств панели задач Windows. Возвращаемого значения нет.

Описание: вызов метода приводит к тому же эффекту, что и команда «Свойства» («Properties») контекстного меню панели задач Windows.

3.17. ControlPanelItem

Назначение: вызов конкретного приложения панели управления. Возвращаемого значения нет.

  • — имя файла конкретного приложения панели управления. Тип — строка. Пустая строка вызывает саму панель управления.

Описание: все файлы приложений панели управления имеют расширение .cpl. Некоторые приложения панели управления:

  • access.cpl — специальные возможности.
  • appwiz.cpl — установка и удаление программ.
  • desk.cpl — настройка экрана.
  • hdwwiz.cpl — мастер установки оборудования.
  • inetcpl.cpl — свойства обозревателя.
  • intl.cpl — язык и региональные стандарты.
  • joy.cpl — игровые устройства.
  • main.cpl — мышь.
  • mmsys.cpl — звуки и аудиоустройства.
  • ncpa.cpl — сетевые подключения.
  • nusrmgr.cpl — учётные записи пользователей.
  • odbccp32.cpl — настройка источников данных ODBC.
  • powercfg.cpl — управление электропитанием.
  • sysdm.cpl — свойства системы.
  • telephon.cpl — телефон и модем.
  • timedate.cpl — настройки времени и даты.

3.18. BrowseForFolder

Назначение: вызов модального окна «Выбор папки». Возвращает объект «Folder».

  • — дескриптор родительского окна. Тип — целое число. 0 — текущее окно.
  • — пояснение для пользователя в окне «Выбор папки». Тип — строка.
  • — целое число (комбинация битовых флагов). Например, флаг 512 — запретить кнопку «Создать папку», 1 — не отображать Корзину, 16 — отображать EditBox для ввода полного пути с клавиатуры и т.п. Подробнее — см. MSDN.
  • — необязательный параметр. Корневая папка в окне «Выбор папки». Тип — строка. Пользователь не сможет пройти в окне «Выбор папки» выше этой папки. Если параметр не указан, корневой папкой будет рабочий стол Windows.

3.19. Windows

Назначение: получение объекта «ShellWindows». Возвращает объект «ShellWindows».

3.20. CanStartStopService

Назначение: определяет, может ли текущий пользователь запустить/остановить указанный сервис. Возвращаемое значение — булево (число).

3.21. IsServiceRunning

Назначение: определяет, запущен ли указанный сервис. Возвращаемое значение — булево (число).

3.22. ServiceStart

Назначение: запускает указанный сервис. Возвращаемое значение — булево (число) — определяет, успешно ли завершена операция.


    — строка, имя сервиса.

— булево (число). Определяет, что сервис должен автоматически стартовать при старте системы. Если указана ложь, конфигурация сервиса не меняется.

3.23. ServiceStop

Назначение: останавливает указанный сервис. Возвращаемое значение — булево (число) — определяет, успешно ли завершена операция.


    — строка, имя сервиса.

— булево (число). Определяет, что сервис должен автоматически стартовать при старте системы. Если указана ложь, конфигурация сервиса не меняется.

3.24. GetSystemInformation

Назначение: возвращает некоторую системную информацию (возвращаемое значение — число).

  • — строка, определяет тип информации.

Описание: подробнее — см. MSDN.

3.25. IsRestricted

Назначение: возвращает значение заданного ограничения по данным реестра (возвращаемое значение — число).

  • — строка, наименование группы (ключа) в HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ policies.
  • — строка, наименование параметра в указанной группе реестра, значение которого надо вернуть.

Описание: если параметр не найден в реестре, возвращается 0. Подробнее — см. MSDN.

3.26. ShellExecute

Назначение: выполняет указанное действие над указанным файлом. Возвращаемого значения нет.

3.27. ShowBrowserBar

Назначение: открывает или закрывает указанную панель обозревателя. Возвращает true в случае успеха, и false в случае неудачи.

  • — строка. Идентификатор класса (CLSID) панели обозревателя. Некоторые возможные значения:
    • Favorites —
    • Folders —
    • History —
    • Search —
  • — булево. True — показать, false — спрятать панель.

Описание: метод доступен только в контексте HTML-документа.

3.28. AddToRecent

Назначение: помещает ярлык на указанный файл в папку «Недавних документов» («Recent») текущего пользователя. Возвращаемого значения нет.

  • — строка. Путь к файлу.
  • — строка (необязательный). Имя категории, в которую помещается файл.

3.29. ExplorerPolicy

Назначение: возвращает значение указанной Internet Explorer policy.

— строка. Имя Internet Explorer policy.

Описание: WindowsXP и выше.

3.30. GetSetting

Назначение: возвращает значение указанной глобальной установки (параметра) проводника.

  • — целое число (набор флагов), определяющее глобальную установку (параметр) проводника. Некоторые возможные значения (подробнее — см. MSDN):
    • 1 — Показывать скрытые файлы и папки.
    • 2 — Скрывать расширения для зарегистрированных типов файлов.

3.31. ToggleDesktop

Назначение: сворачивает или разворачивает все окна на рабочем столе. Возвращаемого значения нет.

Описание: имитирует нажатие на значок «Свернуть все окна» в панели «Быстрый запуск» («Quick launch»).

3.32. WindowsSecurity

Назначение: имитирует нажатие CTRL+ALT+DELETE при использовании соединения Microsoft Terminal Server. Возвращаемого значения нет.

Описание: WindowsXP и выше.

4. Объект Folder

4.1. Создание объекта

Объект виртуальной папки проводника.

4.2. Свойства

4.2.1. Title

Возвращаемое значение: строка — заголовок папки с соблюдением регистра букв. Конструкция:

выведет строку «WINDOWS».

выведет строку «Локальный диск (C:)».

Замечание: только чтение.

4.2.2. Self

Возвращаемое значение: объект FolderItem, соответствующий текущей папке. Аналогично вызову «.Items().Item()».

Замечание: только чтение.

4.2.3. ParentFolder

Возвращаемое значение: объект «Folder» родительской папки.

Замечание: только чтение.

4.2.4. Application

Возвращаемое значение: объект «IShellDispatch».

Замечание: только чтение.

4.2.5. OfflineStatus

Возвращаемое значение: Offline status текущей папки. Тип — целое число.

Замечание: только чтение.

4.3. Методы

4.3.1. NewFolder

Назначение: создание новой папки внутри текущей. Возвращаемого значения нет.

  • — имя создаваемой папки. Тип — строка.
  • — необязательный. В настоящее время не используется.

4.3.2. CopyHere

Назначение: копирование файла или папки вовнутрь текущей папки. Возвращаемого значения нет.

  • — полный путь к копируемому файлу или папке (строка) или объект FolderItem.
  • — необязательный. Опции копирования — число (комбинация битовых флагов). Некоторые флаги (подробнее см. MSDN):
    • 4 — Не показывать окно с прогресс-баром.
    • 8 — Дать копируемому файлу новое имя, если файл с таким именем уже существует.
    • 16 — Отвечать автоматически «Yes to All» в любом отображаемом диалоге.
    • 256 — Отображать окно с прогресс-баром, но не показывать имена файлов.
    • 4096 — Производить операции только в локальной папке. Не производить операции рекурсивно в подпапках.
    • 9182 — Не копировать связанные файлы (например, html-файлы с их папками) как группу. Копировать только указанные файлы.

Описание: копируемый файл или папка может находиться внутри текущей папки. Вызов метода приводит к тому же эффекту, что и перетаскивание файлов в проводнике.

4.3.3. MoveHere

Назначение: перенос файла или папки вовнутрь текущей папки. Возвращаемого значения нет.

Параметры: полностью аналогично методу «CopyHere». См. описание метода «CopyHere».

Описание: полностью аналогично методу «CopyHere». См. описание метода «CopyHere».

4.3.4. Items

Назначение: получение объекта FolderItems. Возвращает объект FolderItems.

4.3.5. ParseName

Назначение: получение объекта FolderItem, соответствующего элементу текущей папки. Возвращает объект FolderItem.

  • — Имя получаемого элемента папки. Тип — строка.

4.3.6. GetDetailsOf

Назначение: получение информации об элементе текущей папки. Возвращает строку.

  • — объект FolderItem, соответствующий элементу текущей папки.
  • — целое число, определяющее тип информации. Возможные значения:
    • 0 — Имя элемента.
    • 1 — Размер элемента (только для файлов).
    • 2 — Тип элемента.
    • 3 — Дата и время последней модификации.
    • 4 — Дата и время создания.
    • -1 — Тип элемента, дата и время последней модификации и размер элемента (только для файлов).

Описание: возвращается информация, похожая на ту, что можно увидеть в окне свойств файла (папки) в проводнике.

4.3.7. DismissedWebViewBarricade

Назначение: см. MSDN. Возвращаемого значения нет.

4.3.8. Synchronize

Назначение: синхронизирует все offline-файлы. Возвращаемого значения нет.

5. Объект FolderItems

5.1. Создание объекта

5.2. Свойства

5.2.1. Application

Возвращаемое значение: объект «IShellDispatch».

Замечание: только чтение.

Пример (Windows XP):

5.2.2. Count

Возвращаемое значение: число. Количество элементов коллекции — элементов папки.

Замечание: только чтение.

5.2.3. Verbs

Возвращаемое значение: объект FolderItemVerbs. Коллекция действий («глаголов»), относящихся ко всем элементам папки.

Замечание: только чтение.

5.3. Методы

5.3.1. Item

Назначение: получение объекта FolderItem. Возвращает объект FolderItem.

  • — необязательный. Индекс в коллекции элементов папки (отсчёт — с нуля). Если параметр опущен, возвращает объект FolderItem, соответствующий самой папке.

5.3.2. InvokeVerbEx

Назначение: выполнить действие операционной системы («глагол») над всеми элементами папки (не рекурсивно). Возвращаемого значения нет.

  • — необязательный. Строка — наименование действия, которое нужно выполнить. Если не указан, выполняется действие по умолчанию.
  • — необязательный. Строка — аргументы действия, указанного в первом параметре.

5.3.3. Filter

Назначение: устанавливает для элементов папки фильтр с использованием групповых символов. Возвращаемого значения нет.

  • — набор флагов фильтрации. Некоторые значения (подробнее — см. MSDN):
    • 32 — учитывать папки.
    • 64 — учитывать не папки.
    • 128 — учитывать скрытые элементы.
  • — строка фильтра.

Читайте также:  Windows 10 новости февраль
Оцените статью