Login | Register

Reboot a computer

July 22, 2006, 22:18 by Calle
[loading]
-->
Microsoft is not stupid, of course they won't let any application suddenly quit Windows. That would obviously be exploited, but there is one way; which is already exploited but still exists. You've heard of a virus that every time your at the computer displays a message saying "You're an idiot. Your computer is going to reboot in 30 seconds."? Well, this is highly possible to create using Game Maker.

file = file_text_open_write("restart.bat";);
string_w = '"Your computer is going to restart in 30 seconds."';
file_text_write_string(file,"shutdown -r -c "+string_w);
file_text_close(file);
execute_shell("restart.bat","";);


See? First I create a batch file, and add my own batch-code, and then I close the file and then I execute it. The trick is the batch-code. You can do basically anything MS-DOS can, by using batch files. So anytime you need to have something done that isn't possible with GML, although it seems simple, you should always search the internet for some batch-code. The above works for windows XP, this is the batch code that works for earlier versions:
[b]START C:\WINDOWS\RUNDLL.EXE user.exe,exitwindowsexec
exit[/b]

The only problem with implementing this code is that the new line needs to remain, therefore you need to split it up into two file_text_write commands and a file_text_writeln in between.

Finally I want to say this: Never use this for ill purpose (although it's quite simple to make an application like this to copy itself and start up with windows, and annoy and make computers unusable for inexperienced users). Always try the application on your own computer and always clearly state that you are going to shut down, and make it an alternative for the user.


Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games