WshShell Class | MSBuild Extension Pack Help 4.0.12.0 |
Valid TaskActions are:
CreateShortcut (Required: Name, FilePath Optional: Arguments, ShortcutPath, Description, WorkingDirectory, IconLocation)
Remote Execution Support: No
Inheritance Hierarchy
MSBuild.ExtensionPackBaseTask
MSBuild.ExtensionPack.ComputerWshShell
Namespace: MSBuild.ExtensionPack.Computer
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The WshShell type exposes the following members.
Constructors
Name | Description | |
---|---|---|
WshShell |
Properties
Name | Description | |
---|---|---|
Arguments |
Sets the Arguments for the shortcut
| |
Description |
Sets the Description. For CreateShortcut defaults to 'Launch [Name]'
| |
FilePath |
Sets the FilePath
| |
IconLocation |
Sets the IconLocation
| |
Name |
Sets the Name
| |
ShortcutPath |
Sets the ShortcutPath. For CreateShortcut defaults defaults to Desktop of the current user
| |
WindowStyle |
Sets the WindowStyle.
1 - Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. 3 - Activates the window and displays it as a maximized window. 7 - Minimizes the window and activates the next top-level window. | |
WorkingDirectory |
Sets the WorkingDirectory
|
Examples
<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath> <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath> </PropertyGroup> <Import Project="$(TPath)"/> <Target Name="Default"> <!-- Create a shortcut --> <MSBuild.ExtensionPack.Computer.WshShell TaskAction="CreateShortcut" Name="My Calculator.lnk" FilePath="C:\Windows\System32\calc.exe"/> </Target> </Project>
See Also