C ,Batch Virus Code To Disable All Hard Disk
DOWNLOAD > https://geags.com/2tvBp6
C ,Batch Virus code to display All Hard disk
In this article, we will learn how to write a simple C program that can create a batch file that will display all the hard disk partitions on a Windows system. This can be useful for learning about the structure and format of batch files and how they interact with the command prompt. However, this code can also be modified to perform harmful actions, such as deleting or encrypting files, so please use it with caution and only on your own system.
The C program will use the fopen and fprintf functions to create and write to a text file named disk.bat. The batch file will contain a single command: wmic logicaldisk get name, which will list all the logical disk names on the system, such as C:, D:, etc. The batch file will also have the @echo off statement at the beginning, which will prevent the command prompt from displaying the commands as they are executed.
Here is the C code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp;
fp = fopen(\"disk.bat\", \"w\"); //create and open disk.bat file
if (fp == NULL) //check if file creation failed
{
printf(\"Error creating file\\n\");
exit(1);
}
fprintf(fp, \"@echo off\\n\"); //write @echo off statement
fprintf(fp, \"wmic logicaldisk get name\\n\"); //write wmic command
fclose(fp); //close file
printf(\"File created successfully\\n\");
return 0;
}
To run the C program, you will need a C compiler, such as GCC or Visual Studio. You can save the code in a file named disk.c and compile it using the command: gcc disk.c -o disk.exe. This will create an executable file named disk.exe, which you can run by double-clicking it or using the command: disk.exe. This will create the batch file disk.bat in the same directory as the C program.
To run the batch file, you can double-click it or use the command: disk.bat. This will open a command prompt window and display all the hard disk partitions on your system. You can close the window by pressing any key or clicking the X button.
Please note that this code is only for demonstration purposes and should not be used for any malicious intent. Modifying or running unknown batch files can cause serious damage to your system or data. Always be careful and responsible when dealing with such files. aa16f39245