Skip to content

Commit

Permalink
pranks part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ValerasNarbutas committed Mar 4, 2024
1 parent ce84ede commit 6156b7f
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Tip of the day - Powershell for April first. Tricks and pranks
title: Tip of the day - Powershell for April first. Tricks and pranks part 1
author: valeras
date: 2023-04-01 10:55:00 +0800
categories:
Expand All @@ -18,7 +18,7 @@ image:
alt: Tip of the day - Powershell for April first
---

## Tip of the day: Aprils Fools' Day pranks with Powershell
## Tip of the day: Aprils Fools' Day pranks with Powershell Part 1

Apply these pranks to your colleagues' computers. They will be surprised and will have a good laugh.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
title: Tip of the day - Powershell for April first. Tricks and pranks Part 2
author: valeras
date: 2024-03-04 10:55:00 +0800
categories:
- TipOfTheDay
- TipsAndTricks
tags:
- powershell
- tipoftheday
- sharepoint
- pranks
pin: false
slug: tip-day-powershell-april-part-2
comments: true
image:
path: /img/posts/pranks2.png
alt: Tip of the day - Powershell for April first 2
---

## Tip of the day: Aprils Fools' Day pranks with Powershell Part 2

Apply these pranks to your colleagues' computers. They will be surprised and will have a good laugh.

> Note: These pranks are harmless and will not cause any damage to the computer. They are just for fun.
{: .prompt-info }

> Note: If you have any other ideas for pranks, please share them in the comments.
{: .prompt-info }

## Most useful commands

### Random Mouse Movements:

```powershell
Add-Type -AssemblyName System.Windows.Forms
For ($i = 0; $i -lt 100; $i++) {
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((Get-Random -Min 0 -Max 1920), (Get-Random -Min 0 -Max 1080))
Start-Sleep -Milliseconds 500
}
```

### Change the System Volume Randomly:

```powershell
$volume = New-Object -ComObject WScript.Shell
For ($i = 0; $i -le 10; $i++) {
$volume.SendKeys([char]175) # Volume Up
Start-Sleep -Milliseconds 200
$volume.SendKeys([char]174) # Volume Down
}
```

### Narrator Announces Fake Updates:

```powershell
Add-Type -AssemblyName System.Speech
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$speak.Speak('Installing mandatory updates for Clippy, your helpful office assistant. Please do not turn off your computer.')
```

### Random Error Message Pop-ups:

```powershell
[Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
[System.Windows.Forms.MessageBox]::Show('Error 404: Keyboard not found. Press F1 to continue.', 'System Error', [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Error)
```

### Open a Random Website in the Default Browser Periodically:

```powershell
$websites = @('http://example.com', 'http://example.org', 'http://example.net')
while ($true) {
Start-Process (Get-Random -InputObject $websites)
Start-Sleep -Seconds (Get-Random -Min 300 -Max 1800) # Randomly between 5 minutes to 30 minutes
}
```

### Hide All Icons on Desktop:

```powershell
$path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
Set-ItemProperty -Path $path -Name HideIcons -Value 1
Stop-Process -Name explorer -Force
Start-Process explorer
```

### Change Desktop Background to a Funny Image:

```powerShell
# Ensure the path to the image is correct and accessible
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name Wallpaper -Value 'C:\path\to\funny-image.jpg'
RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
```

### Infinite Loop of notepad opening and closing:
```powershell
while ($true) {
Start-Process notepad
Start-Sleep -Seconds 10
Get-Process notepad | Stop-Process
Start-Sleep -Seconds 5
}
```

If you missed the first part of the pranks, you can find them here > [Tip of the day - Powershell for April first. Tricks and pranks](https://valerasnarbutas.github.io/posts/tip-day-powershell-april/).
Binary file added assets/img/posts/pranks2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6156b7f

Please sign in to comment.