Fun fact: killing important processes in windows is not allowed but suspending them is… suspending "csrss.exe" for example hangs the system immediately and is impossible to recover from unless you force shutdown. I accidentally tested this and was surprised that it’s allowed
whenever i code in python it's like my brain automatically forgets all this crucial info and i need to look at the documentation for half an hour to learn what i already know
A reminder that using a forward slash (/) also works, but i suppose it is faster to just make it a raw string due to how the Explorer prefers to use backslashes
@@qlx-i Powershell has its issues too. It's both a shell/scripting language _and_ a fully-fledged .net language, and native methods and .net stuff act in different ways. For example when you mess up the syntax they give different (and non-intuitive) feedback, and the working directories for native and .net methods are distinct. Truly the worst programming language I've ever had to use, barring esoteric languages and the like.
Yes, you survive as long as you don't pass out. You can probably heal from that though, I am not sure how it works but I guess you could download the folder somewhere
Yeah while you could change the installation directory in versions like 9x in modern versions, you have to jump through a lot of hoops to do that. Enderman has a video on it
I‘m not sure (haven‘t look into the documentation in this case specifically) but often with functions that you give a range it is inclusive on the lower boundary and exclusive on the upper boundary. for x in range(0,5): print(x) Will give you 0 1 2 3 4 If that is the case for this randint function the revolver has six chambers: 0, 1, 2, 3, 4 and 5. Bottom line: read the documentation , everyone.
This is weird. I thought the System32 folder was protected by TrustedInstaller and as such not administrator permissions weren't even enough to remove it.
@@Jupiter__001_ yes. Even more. I would expect that the first user always has admin/sudo permissions. It is simple logic - there are no users but me. If I can not do whatever I want, then who can?
@@fast_python yes but OS critical files should be protected to prevent some random script from destroying your system. And in fact - they are. Most system32 files are owned by TrustedInstaller or the System user and their ACL don't include administrators. To alter windows system files you have to - Change ownership of the file to yourself (takeown) - Grant yourself total control over the file (icacls) But... I guess we're back to square 1, since you can do that automatically too. Someone suggested that the OS should be stored on a protected partition and that any modifications should be submitted to manual confirmation. Anyway, I wonder: did you alter the permission sets of System32 files before recording this video? I'd test it myself but I don't have access to a windows vm right now.
@@5cover No, it is the default system installed from the image downloaded from the official MS website. I just uninstalled some excessive packages like Solitaire and XBox and switched off additional services like OneDrive. Oh, and changed the appearance to show hidden folders and file extensions. Visual effects were switched off in order to increase the performance. This VM has 4 GB RAM and even after all of this, Windows still works slowly as hell.
For the permission error I think instead of ignoring the errors, privilege escalation and run using SYSTEM permission could help delete everything from the windows folder (b4 it crashes)
There's no such file in the current directory called that complex string... But even if there were it would have a 14% chance of deleting it for some reason?
One time I deleted EVERYTHING (that I could) on my school laptop so if someone asks why I got linux I just say I got a virus and couldn't reinstall so I just didn't bother and used linux instead (I use arch btw)
You know what is realy bad about this program? random.randint is INCLUSIVE Most of the program do random.randint(0,6), but that is not russian roulette as it can either be 0, 1, 2, 3, 4, 5 or 6. a total of 7 numbers.
@@fast_python I know there are 7 shot revolvers but those are rare(r). They clearly want to imitatie Russian roulette with a normal revolver, but forgot randint is inclusive
subscribe, watch my videos, and you will see how many aspects should be considered to program run fast. And the language is the least important of them 😉
In python, if a backslash is not succeeded by a valid character to escape, it just treats the backslash as a normal backslash. Here, W and S are not escapable characters, so there is no error in the string literal. What you got was a SyntaxWarning, which is just an advisory rather than an actual error.
at the same time developers who ignore warnings get unexpected behavior later. Though warnings do not prevent code from running right now, they should be addressed accordingly
@@enosunim rm: it is dangerous to operate recursively on '/' rm: use --no-preserve-root to override this failsafe If you use the asterisk it works though.
int main(void) { while (true) [[maybe_unused]] auto t = new int[2048]; } here it is in c++, it removes the need to include the header file for malloc :p
@@az-kalaak6215 who in the right mind would write ``` int main(void) ``` This isnt C, write cpp in cpp style else it will lead to UB or other security glitches. What you should have written is ``` int main() ```
You can also you "/" for directory separator, this also works on Windows. Good point on single "\" as a wrong way of directory separation. Though it does not raise an error immediately. But if you file name or folder will start with "u" for example, it will likely cause critical error, that code does not run at all. Which will frustrate noobs, who write single "\" and it was 'OK' and suddenly 'BOOM'. = )
System32 has write protection, you need to first create a symbolic link to system32 to trigger a glitch in the write protection logic and then remove everything in that symbolic link.
I believe it's a bug because error message should describe what went wrong. In this case you have nothing to do with permissions. So this message is misleading. Btw, linux shows OSError as documented
My errors are red.
My screen is blue.
I think I deleted system32.
underrated comment
what is Dr. Seuss doing here?
Gold
Genius
This is the best one by far.
Alternative video title: how to save 1GB of space on C disk
Just never shut your computer down ever again and you can get a whole free gigabyte 🤌
With just 2 lines of code!
But remember, do not restart!
😭
and destroy windows LOL
I always assumed these types of scripts were wrong on purpose in case anyone was dumb enough to try them
I assumed they were just pseudocode that are easy readable and only mimicing python. Just to convey the idea
I assumed that the code was a joke but it turns out the real joke was my pc not booting
@@Duckman4444 Yes, that would be the punchline... that or the punch from the device owner. 😭
@@km077but that would just be a punch, not a line. or maybe it'll be the user's heart going flatline
@@legodragonx And here I was thinking Python was just pseudocode that's easily readable and only mimicking a _real_ programming language 😛
Fun fact: killing important processes in windows is not allowed but suspending them is… suspending "csrss.exe" for example hangs the system immediately and is impossible to recover from unless you force shutdown. I accidentally tested this and was surprised that it’s allowed
yeah, this is really fun 😆
genius to do that after this
You can delete them, but it requires a lot of knowledge around windows
Meanwhile Linux allows you to delete the fricking kernel and run zeros over it, and if it tries to complain you just yell a little harder
Try running cmd as TrustedInstaller or System. Not usually allowed, but who cares what Microsoft thinks. ;)
"The system is dead it just doesn't know it yet"
Python: "Omae wa mou shindeiru"
Windows: "NANI?"
🎅🎅🐡🥕
Hey apple?
What?
Import random
Import os
If random.randint(0,6) == 1:
| os.remove("C:\Windows\System32")
Your 100th like
Windows: "I'm not dead yet!"
Add lines to reboot PC after that ☠️
`os.system("shutdown -t 0 -r -f")`
It doesn’t matter ether way, windows will already be dead
@@4sent4 "shutdown /r /f /n" for Windows (reboot force now)
@@TenCreator-2 since OS is loaded on RAM, effect won't be visible. But forcing a reboot will surely be fun
@@comrade_marshal yeah, I didn’t think of that, would be fun tho
"Tutorial on deleting bloatware from windows" *deletes windows*
Tutorial on deleting windows from bloatware
bro just gave us a tutorial to delete system32 with python
yes, that was the purpose of this video, thanks for pointing that out.
Nice one Sherlock! You figured out what the video was about!
thx thx, i know i saved people lifes, thx
Apply Russian Roulette (random) mechanics and we have danger!
You learned grammar from TikTok or what?
"Feel free to share it :)"
what? The .py?
🤣
.py
whenever i code in python it's like my brain automatically forgets all this crucial info and i need to look at the documentation for half an hour to learn what i already know
I literally searched for
"How to print messages with python"
Clicked search and the moment I saw "print" I just felt embareced
me lookin up how to open files at least 10 times a day
Reminds me of the time I made a function called trace that just printed the argument passed @@Marc-qz3bj
Windows is already a form of Russian Roulette
So is Python.
no, it makes you want to do russian roulette
Now imagine the potential, you can disguise this as a piracy installer for League of legends and watch the world burn
That is why one should think twice before running a cracked software
how would you pirate a free game
@@art0007i game repacks for smaller download size
I'd rather that than install the actual game, you'd do me a solid 👌
@@art0007i that's the point 💀
A reminder that using a forward slash (/) also works, but i suppose it is faster to just make it a raw string due to how the Explorer prefers to use backslashes
good point
It also can be platform dependent in certain use cases
A reminder that windows is fucking trash and nothing in cmd is even remotely stndardized
@@realitant to be fair, the directory being deleted is also platform-dependent
@@qlx-i Powershell has its issues too. It's both a shell/scripting language _and_ a fully-fledged .net language, and native methods and .net stuff act in different ways. For example when you mess up the syntax they give different (and non-intuitive) feedback, and the working directories for native and .net methods are distinct. Truly the worst programming language I've ever had to use, barring esoteric languages and the like.
Glad I wasn’t the only one who always got mildly annoyed whenever I saw this joke
randint(0, 6) is 7 options :)
Exactly!
sometimes i forgot randint(a, b) chooses a random number between a and b,,,, and not a to b - 1 😅
@@tonylovesmusicfr, I don't even know if it's good or bad
@@Rando2101 I'd say it's good only because of consistancy with both numbers. Easier to explain to newer people to programming
yeah, it can be 0, 1, 2, 3, 4, 5 or 6 which is 7 choices
So the gun can't instantly kill you but you eventually bleed out 🤔
Yes, you survive as long as you don't pass out. You can probably heal from that though, I am not sure how it works but I guess you could download the folder somewhere
@@tundcwe123 "Hey bro... Can you email me your entire system32 folder?"
"What? Why?"
"My computer is bleeding to death..."
"WHAT?!?!?!"
@@filval387 "It lost in Russian roulette. Just email me the folder."
it can hurt you in other ways X)
The joke has another problem - Windows is not always installed in C:\Windows. You should be using the SystemRoot environment variable.
whats the code then?
@@seavuy aww cute
The guy who has windows installed in something other than C:\Windows is probably smart enough to not run random python scripts already lol
@@seavuy either os.environ["SystemRoot"] if the commenter is to trust idk i use linux
Yeah while you could change the installation directory in versions like 9x in modern versions, you have to jump through a lot of hoops to do that. Enderman has a video on it
you gave the revolver 7 chambers
edit: you clearly have no idea how random.randint works, so before replying rtfm
I am not the first one en.wikipedia.org/wiki/Nagant_M1895
bro got the the premium
I‘m not sure (haven‘t look into the documentation in this case specifically) but often with functions that you give a range it is inclusive on the lower boundary and exclusive on the upper boundary.
for x in range(0,5):
print(x)
Will give you
0
1
2
3
4
If that is the case for this randint function the revolver has six chambers: 0, 1, 2, 3, 4 and 5.
Bottom line: read the documentation , everyone.
@@dizzeep2023 randint does not work like range
@@fast_python LMAO
the bluescreen gave me a heart attack because i thought it was on my pc
I know why it's wrong! Programming is illegal on windows unless you create a project in some hideous visual studio bloatware
mama ama criminal
This is weird. I thought the System32 folder was protected by TrustedInstaller and as such not administrator permissions weren't even enough to remove it.
Any system can be broken with admin permissions. That is why by default many Linux distributions does not include users in sudoers
@@fast_pythonBut that is a bit counterproductive because in Linux you need root permissions to install programmes
@@Jupiter__001_ yes. Even more. I would expect that the first user always has admin/sudo permissions. It is simple logic - there are no users but me. If I can not do whatever I want, then who can?
@@fast_python yes but OS critical files should be protected to prevent some random script from destroying your system. And in fact - they are. Most system32 files are owned by TrustedInstaller or the System user and their ACL don't include administrators.
To alter windows system files you have to
- Change ownership of the file to yourself (takeown)
- Grant yourself total control over the file (icacls)
But... I guess we're back to square 1, since you can do that automatically too.
Someone suggested that the OS should be stored on a protected partition and that any modifications should be submitted to manual confirmation.
Anyway, I wonder: did you alter the permission sets of System32 files before recording this video? I'd test it myself but I don't have access to a windows vm right now.
@@5cover No, it is the default system installed from the image downloaded from the official MS website. I just uninstalled some excessive packages like Solitaire and XBox and switched off additional services like OneDrive. Oh, and changed the appearance to show hidden folders and file extensions. Visual effects were switched off in order to increase the performance. This VM has 4 GB RAM and even after all of this, Windows still works slowly as hell.
The second I saw this meme I was instantly disgusted by how it fails to give you the correct odds. We need to correct this meme globally somehow
They didnt even test their code smh
Glad you noticed that my gun wasn't properly loaded before I shot my foot off.
Bro tried to kill PC accidentally made a debloater if you dont restart 💀
Great video. I watched on my PC, but needed to comment on my phone.
Люблю подобные ролики, когда юмор рассматривается серьёзно и из этого получается обучающий контент. Спасибо за видео!
Better video title: how to shutdown windows as fast as possible
...forever
1:51 you can also just use a /. Modern Windows recognizes it just fine.
4:24 at this moment, the PC has died, it just doesn't know it yet.
It would be even better to make this script os agnostic, so it just removes the root
Unnecessary, only Windows even needs a program to do this. On Linux, you just sudo rm -rf /, and you're done.
It’s done in Python, that makes it wrong. Because everybody can read this and avoid running it. Program it in assembly with some nice obfuscation
the point of russian roulette is that you know what you are getting into. what you are saying would just be an assassination, which is no fun.
when i first saw this meme i knew the issue and ran on purpose just to prove my point to myself
"it's just a joke bro"
the joke:
Thanks I sent this to my computer science teacher
This window is already dead, it just doesn't know it ... 💀
sudo rm -rf / -no-preserve-root
that's linux
If they're on Linux that will work, if you have sudo perms and you can type your password for the sudo.
rm -fr ~/*
deletes the french localization :v
@@fiona9891sounds about right >:)
pacman -R base --no-confirm starts a game of pacman on the level "base"@@fiona9891
Force restart after deleting files with
_shutdown -r -t 0_
The problem with this piece of code is that it is not testable easily without a bunch of complicated mockups...
It can be easily tested on a virtual machine. Don't forget to make a snapshot before to restore the system
@@fast_python Sorry, it was not clear that my comment was a joke, and I meant testable as in with e.g. pytest
@@qexat oh, I didn't even think in that direction 😄
Programming with puhon be like:
- Why on earth couldn't the function print an error message that made any sense?
- Permission error.
"I think it's Win"
I see what you did there
"And the system still works.... unless we reboot it" 😂😂
thanks for teaching us how to sixthly destroy our computer
Russian roulette that deletes system32 with a 1 in 6 chance of deleting it.
1 in 7 lol randint includes both ends
@@nekomimicatearsI haven’t coded in python for a few months 😅 sorry
Crazy how you can destroy a PC with a single line of code 😨
Already at 0:16 and I'll try to guess the problem: backslashes must be escaped by putting each one twice.
Ok so it's more complex than that.
The easier way is to boot from some other system before deleting the Windows one.
For the permission error I think instead of ignoring the errors, privilege escalation and run using SYSTEM permission could help delete everything from the windows folder (b4 it crashes)
There's no such file in the current directory called that complex string... But even if there were it would have a 14% chance of deleting it for some reason?
Bro taught us how to make a virus
I use Linux, so _this script_ will not work.
So, change the path to "/" 🤣
hope author will do "what is wrong with rm -rf" about sudo, --preserve-no-root and some other stuff
if "posix" in os.name:
os.rmdir("/", ignore_errors=True)
else:
os.rmdir(r"C:\Windows\System32", ignore_errors=true)
@@AlfieLikesComputers better:
path = r"C:\Windows\System32" if os.name == "nt" else "/"
shutil.rmtree(path, ignore_errors=True)
@fast_python but that will not work in windows
Will there be a single, same script that works in every OS possible?
One time I deleted EVERYTHING (that I could) on my school laptop so if someone asks why I got linux I just say I got a virus and couldn't reinstall so I just didn't bother and used linux instead (I use arch btw)
the real error is that generating a number between 0 and 6 would be like rolling a 7 sided die
On Windows XP this would work if hal.dll was selected instead of the System32 folder, and when you reboot it won't work anymore.
Yeah, I beleve there is a particular file which can be deleted with the same result
well '\' is usually an escape sequence character so they probably should've used '/'
You know what is realy bad about this program? random.randint is INCLUSIVE
Most of the program do random.randint(0,6), but that is not russian roulette as it can either be 0, 1, 2, 3, 4, 5 or 6. a total of 7 numbers.
yes, but russian roulette is not about numbers, but about a principle. Though there are 7 shot revolvers
Nah the devs definitely just forgot that random ranges are inclusive lol
@@Jwellsuhhuh precisely
@@fast_python I know there are 7 shot revolvers but those are rare(r). They clearly want to imitatie Russian roulette with a normal revolver, but forgot randint is inclusive
It's a safer, kid variant of the original
The only thing wrong with this Python joke is the channel name.
subscribe, watch my videos, and you will see how many aspects should be considered to program run fast. And the language is the least important of them 😉
The problem of windows is that no difference which error happened, it will say "Permission denied"
In python, if a backslash is not succeeded by a valid character to escape, it just treats the backslash as a normal backslash. Here, W and S are not escapable characters, so there is no error in the string literal. What you got was a SyntaxWarning, which is just an advisory rather than an actual error.
at the same time developers who ignore warnings get unexpected behavior later. Though warnings do not prevent code from running right now, they should be addressed accordingly
nice they gave you a 30% chance to win in here
Well imagine fixing it given 0 chance to fix it.
So all you need to do is write a shutdown command at the end of file.
So we can't remove all directory using python
Actually, you can if you really want to. You can do it from another OS, for example using boot cd.
@@fast_python What about it reboots every time, and has a random chance to overwrite the windows boot manager so it deletes everything instead lol
@@AlfieLikesComputersis it possible to yeet the EFI partition too?
@@imaguyyesmale Probably, if it isn't, it is at least able to overwrite it to mess it up in some way i think
@@AlfieLikesComputers oooh, -nice- to know!
I wonder if with win32security one can set more Windows files owner to the user and delete more.
Subscribed, Shared, Saved!
My life has been paved!
Me watching this from linux:
"You have no power here"
sudo rm -rf /*
@@enosunim
rm: it is dangerous to operate recursively on '/'
rm: use --no-preserve-root to override this failsafe
If you use the asterisk it works though.
Yeah, that's it, I do not want to remove the root. I just want to remove all subdirectories at the first level = )
mission failed? not today...
I think this will actually work like a Russian roulette for windows if the python code causes windows to restart no matter the number chosen
Next make a C progran that alocs memory until the PC explodes
😢
so... a C bomb?
@@powered_by_source That's right 🤣
int main(void)
{
while (true)
[[maybe_unused]] auto t = new int[2048];
}
here it is in c++, it removes the need to include the header file for malloc :p
@@az-kalaak6215 who in the right mind would write
```
int main(void)
```
This isnt C, write cpp in cpp style else it will lead to UB or other security glitches. What you should have written is
```
int main()
```
System32 is your PC literally, if I'm sure this also happens upon deleting a specific file in Undertale.
Nothing, I’m on a unix system
Try sudo rm -rf / --no-preserve-root
kid named -rf
The joke is a russian roulette of computers in less words
You can also you "/" for directory separator, this also works on Windows. Good point on single "\" as a wrong way of directory separation. Though it does not raise an error immediately. But if you file name or folder will start with "u" for example, it will likely cause critical error, that code does not run at all. Which will frustrate noobs, who write single "\" and it was 'OK' and suddenly 'BOOM'. = )
The fact that you assumed that the OS library would ever work
it was not me 😀
System32 has write protection, you need to first create a symbolic link to system32 to trigger a glitch in the write protection logic and then remove everything in that symbolic link.
I made one for linux that did rm -rf --no-preserve-root and that one did work. All it needed was sudo which is easy to implement in python
I would say "rm rf /" is closer to "format c:". I mean it is about underlying OS. In python It may be shutil.rmtree("/"). Obviously, with sudo
LETS GO GAMBLING!
*pc gets bricked*
aw dang it
2:05 PermissionError is a subclass of OSError, it's just a more specific type.
I believe it's a bug because error message should describe what went wrong. In this case you have nothing to do with permissions. So this message is misleading. Btw, linux shows OSError as documented
Зер ар северал вериэнтз бат вот зей олл хев ин коммон
English cyrillic...
It doesn't do anything on my Linux
It's a lie. At least it should show FileNotFoundError
@@fast_python haha, yea I actually used Android, so I can't run it
there should be a linux version of this
"os.system("sudo rm -rf / --no-preserve-root")"
it's here ruclips.net/video/qWp7XqiJKqk/видео.html ;)
@@fast_python no way lol
WHAT KIND OF MAD MAN WOULD MAKE THAT USEABLE CODE IT WAS MENT TO BE WROUNG!
me 😆
@@fast_python Fair enough.
Got this on recommendation
System32 is bloatware anyway. Yes, i use Arch.
It has its purpose and it works well according to it. I don't want to cope with wine and other tricks just to make the software work
Clearly you're pretending. Real Arch users say: "I use Arch, BTW." ;-)
did you actually just pull the "i use arch btw" unironically?
The backslashes are treated as escape sequences since you didn’t type it like this: “\\”
Also, it requires administrator privileges
I mean if you ask "What is wrong with this Python 'joke'?", The answer would be the existence of this video debunking the joke...
Might be possible to do from inside safe mode boot
My dude is gambling with Windows XD
Runs on linux 🗿
specially for linux/mac users there is the part 2 ruclips.net/video/qWp7XqiJKqk/видео.html 😉
And they didn't work on every Linux distro in common!
"hey system32 sounds like a virus, so i made an antivirus just to delete it."
32-bit systems are obsolete. Just delete it and use a modren 64-bit one
Alright, time to trick a scammer into using this
oh this guy's russian? ok i believe him completely
exec(‘sudo rm -rf’)
Oh wow. Python is really cool when it comes to this things.
If you want to know, just try it.
It isn't platform independent
why does he kinda sound like yoda?
because English is not my native language
Unix/linux users:
You have no power here.
Neat, so you can break a Windows system in the same way as a Linux system, even if it's only one of a million ways.
but I'm relieved because the joke is really a joke, not a deletes like this