Stop Others from Using Your Laptop: Easy Auto Shutdown Script
Worried about someone sneaking into your laptop when you’re not around? Passwords are great, but sometimes you want an extra layer of protection. In this guide, I’ll show you a simple VBScript auto shutdown trick that will instantly turn off your laptop if a secret folder isn’t found — making it nearly impossible for unauthorized users to access your files.
The Magic Code ✨
Here’s the script with comments so you can understand how it works: Download the script
Option Explicit ' Force all variables to be declared (good coding practice)
' ============================
' Laptop Auto Shutdown Script
' ============================
' This script adds an extra layer of security to your laptop.
' It checks for the presence of a "secret folder" every time
' the system starts. If the folder is missing, it will
' automatically shut down the computer to prevent unauthorized use.
' ============================
' Step 1: Set your secret folder path here (e.g., "C:\Users\admin\Desktop\XYZfoldername")
Dim folderPath
folderPath = "C:\setyourMySecretFolder"
' Step 2: Create FileSystemObject to check if the folder exists
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
' Step 3: Pause for 10 seconds after startup
' (change the time as per your need — for example, 1 minute = 60000)
WScript.Sleep 10000
' Step 4: If the secret folder is missing, trigger system shutdown
If Not fso.FolderExists(folderPath) Then
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run "shutdown /s /t 1", 0, False ' Shutdown immediately
End If
How It Works 🛠️
- Set your folder path: Change
C:\MySecretFolder
to your own secret folder path. - The folder check: The script uses FileSystemObject to see if that folder exists.
- 10-second delay: Gives your system enough time to start before running the check.
- Shutdown command: If the folder is missing, the laptop shuts down instantly.
Steps to Use It 💻
- Open Notepad and paste the script above.
(Step 1 & 2 are optional, if you already downloaded the script, but you need to make some changes like setting your secret folder path and time as per your need!)
- Save the file as security.vbs (make sure the extension is
.vbs
). - Place it in your Startup folder:
- Press
Win + R
, typeshell:startup
, and hit Enter. - Copy your
security.vbs
file into this folder.
- Press
- Create the secret folder at the path you set in the script.
- You’re done! ✅
Final Thoughts
This trick won’t replace strong passwords or advanced security tools, but it’s a clever way to stop others from using your laptop. The next time someone tries to snoop around and your secret folder isn’t there, your laptop will shut down before they can log in.