Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[green]
<#'==========================================================================
'
' NAME: SendToPowerShell.ps1
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' DATE : 5/9/2011
' COPYRIGHT ¬ 2011, All Rights Reserved
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
' COMMENT: You are free to use this code provided you keep all original
' header information in the script.
'
'==========================================================================
#>[/green]
$SendTo = [System.Environment]::GetFolderPath("SendTo")
$OS = gwmi win32_OperatingSystem
$OSDir = $OS.WindowsDirectory.Trim()
$objShell = New-Object -com "Wscript.Shell"
if ($OS.OSArchitecture -eq "64-bit")
{
$objShortcut = $objShell.CreateShortcut($SendTo + "\PowerShell(x86).lnk")
$objShortcut.TargetPath = "$OSDir\SysWOW64\WindowsPowerShell\v1.0\PowerShell.Exe"
$objShortcut.Save()
}
$objShortcut = $objShell.CreateShortcut($SendTo + "\PowerShell.lnk")
$objShortcut.TargetPath = "$OSDir\System32\WindowsPowerShell\v1.0\PowerShell.Exe"
$objShortcut.Save()
'=============================================='
' NAME: SendToPowerShell.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: http://www.thespidersparlor.com
' DATE : 4/24/2008
' COPYRIGHT (c) 2008 All Rights Reserved
'
' COMMENT: Adds SendTo right menu choice for PowerShell.
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'================================================
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
strSendToFolder = WSHShell.SpecialFolders("SendTo")
If Not objFSO.FolderExists(Windir & "\sysWOW64") Then
strPathToNotepad = WinDir & "\system32\WindowsPowerShell\v1.0\powershell.exe"
Set objShortcut = WSHShell.CreateShortcut(strSendToFolder & _
"\PowerShell.lnk")
objShortcut.TargetPath = strPathToNotepad
objShortcut.Save
Else
strPathToNotepad = WinDir & "\sysWOW64\WindowsPowerShell\v1.0\powershell.exe"
Set ps86 = WSHShell.CreateShortcut(strSendToFolder & _
"\PowerShell(x86).lnk")
ps86.TargetPath = strPathToNotepad
ps86.Save
strPathToNotepad = WinDir & "\system32\WindowsPowerShell\v1.0\powershell.exe"
Set ps64 = WSHShell.CreateShortcut(strSendToFolder & _
"\PowerShell.lnk")
ps64.TargetPath = strPathToNotepad
ps64.Save
End If