-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathSecureScreenStopper.ps1
More file actions
37 lines (31 loc) · 1.03 KB
/
SecureScreenStopper.ps1
File metadata and controls
37 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Clear-Host
Add-Type -AssemblyName System.Windows.Forms
# Rename Powershell Window
$PowershellConsole = (Get-Host).UI.RawUI
$PowershellConsole.WindowTitle = "Secure Screen Stopper"
#Declare Variable
$button = $null
$Global:MainProcess
$Global:RelativePath
$Global:MMProcess
Function GetRelativePath{
$Global:RelativePath=(split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"
Write-Host $Global:RelativePath
}
Function KillProcesses{
$Running = Get-Process -Name conhost -ErrorAction SilentlyContinue
If($Running -ne $null){
Stop-Process -Name conhost -Force
}
$Running = Get-Process -Name powershell -ErrorAction SilentlyContinue
If($Running -ne $null){
Stop-Process -Name powershell -Force
}
}
GetRelativePath
$a = "-WindowStyle Minimized -File"+[char]32+[char]34+$Global:RelativePath+"MouseMover.ps1"+[char]34
Write-Host $a
Start-Process powershell.exe $a
$button = [system.windows.forms.messagebox]::show("Click OK to reinstate secure screen saver!")
#Start-Sleep -Seconds 10
KillProcesses