PowerShell Script to create a fake BSOD blue screen of death in windows

Hi Everyone! Today we are back with another interesting article. But this time it is not technical but technical with fun. In this article, we will show how you can fool your friends with a fake BSOD screen in Windows which is also called windows stop code. We will create a PowerShell Script To Create A Fake BSOD Blue Screen Of Death In Windows

Windows blue screen of death
Blue Screen Of Death

What Is PowerShell?

PowerShell is a scripting language like bash and python. It comes pre-built with the Windows operating system out of the box. All the scripts are saved with the ps1 extension.

PowerShell Script To Create A Fake BSOD Blue Screen Of Death In Windows

Here comes the main content. now we will write a script to create a fake BSOD screen to fool people. First of all, Open the Windows PowerShell ISE from Start Menu and begin writing as below.

$Text = @'
A problem has been detected and Windows has been shut down to prevent damage 
to your computer.

CRITICAL_SERVICE_FAILED

If this is the first time you've seen this Stop error screen, 
restart your computer. If this screen appears again, follow
these steps:

Check to make sure any new hardware or software is properly installed.
If this is a new installation, ask your hardware or software manufacturer
for any Windows updates you might need.

If problems continue, disable or remove any newly installed hardware 
or software. Disable BIOS memory options such as caching or shadowing.
If you need to use Safe Mode to remove or disable components, restart
your computer, press F8 to select Advanced Startup Options, and then
select Safe Mode.

Technical Information:

*** STOP: 0x0000005A (0x00000001, 0x00000001, 0x00000000, 0x00000000)

Collecting data for crash dump ...
Initializing disk for crash dump ...
Beginning dump for physical memory.
Dumping physical memory to disk: 100
Physical memory dump complete.
Contact your system admin or technical support group for further assistance.
'@

Here $Test is the variable in which we will store our error message as Multiline String or Here String (as called in PowerShell).

Now write the following :

Add-Type -AssemblyName System.Windows.Forms

The above line of code is used to create a Windows Form from its .Net class.

$Label = New-Object System.Windows.Forms.Label
$Label.TabIndex = 1
$Label.Text = $Text
$Label.ForeColor = 'White'
$Label.AutoSize = $True
$Label.Font = "Lucida Console, 16pt, style=Regular"
$Label.Location = '0, 30'

We have used $Label variable to create an object from Form.Label class. This variable will hold the error code which we stored in $Text variable.

$Form = New-Object system.Windows.Forms.Form
$Form.Controls.Add($Label)
$Form.WindowState = 'Maximized'
$Form.FormBorderStyle = 'None'
$Form.BackColor = "#000080"
$Form.Cursor=[System.Windows.Forms.Cursors]::WaitCursor
$Form.ShowDialog()

Here we are creating our another and last object from Windows.Forms class to create the main form which will create illusion of actual Blue Screen of Death error.

Here is the complete script:

$Text = @'
A problem has been detected and Windows has been shut down to prevent damage 
to your computer.

CRITICAL_SERVICE_FAILED

If this is the first time you've seen this Stop error screen, 
restart your computer. If this screen appears again, follow
these steps:

Check to make sure any new hardware or software is properly installed.
If this is a new installation, ask your hardware or software manufacturer
for any Windows updates you might need.

If problems continue, disable or remove any newly installed hardware 
or software. Disable BIOS memory options such as caching or shadowing.
If you need to use Safe Mode to remove or disable components, restart
your computer, press F8 to select Advanced Startup Options, and then
select Safe Mode.

Technical Information:

*** STOP: 0x0000005A (0x00000001, 0x00000001, 0x00000000, 0x00000000)

Collecting data for crash dump ...
Initializing disk for crash dump ...
Beginning dump for physical memory.
Dumping physical memory to disk: 100
Physical memory dump complete.
Contact your system admin or technical support group for further assistance.
'@
Add-Type -AssemblyName System.Windows.Forms

$Label = New-Object System.Windows.Forms.Label
$Label.TabIndex = 1
$Label.Text = $Text
$Label.ForeColor = 'White'
$Label.AutoSize = $True
$Label.Font = "Lucida Console, 16pt, style=Regular"
$Label.Location = '0, 30'

$Form = New-Object system.Windows.Forms.Form
$Form.Controls.Add($Label)
$Form.WindowState = 'Maximized'
$Form.FormBorderStyle = 'None'
$Form.BackColor = "#000080"
$Form.Cursor=[System.Windows.Forms.Cursors]::WaitCursor
$Form.ShowDialog()

Save this file as miracle.ps1 and to run the script, right-click on this file and click on Run with PowerShell. When you run this script, you will get something like this. Now it is ready to share

Windows blue screen of death
Blue Screen Of Death

Note: Now you will be thinking how to get out of this :D? Just press ctrl + shift + ESC and End the PowerShell task.

Other Interesting Articles:

Leave a Comment