Can i make batch unclosable - batch-file

Ive been looking for answer to this question but so far unsucessfully. Can i somehow make it that after batch file is started it wouldnt close if you would press X button on top right (the exit button)? If yes, how to do that?
code for "fake virus"
#echo off
color 47
net stop themes >nul
title DEEP VIRAL INFECTION!
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo ERROR!!!
echo -
echo virus - TROJAN_DEMOLISHER code #45643676
echo -
echo FIREWALL - FAILED
echo -
echo ANTI-VIRUS - FAILED
echo -
echo IP ADDRESS BREACHED!
echo -
echo VIRUS ATTAINING: ****-****-****-8894
echo -
pause
cls
echo -
echo SCANNING INFECTED AREAS...
echo -
pause
title SCANNING INFECTED AREAS...
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
:end
cls
title DEEP VIRAL INFECTION!
echo -
echo 86.5 PERCENT OF MEMORY INFECTED
echo -
echo INFECTION FATAL!
echo -
echo DELETION OF ENTIRE CONTENTS OF LOCAL DISK C: REQUIRED
echo -
pause
cls
echo -
title DELETING HARD-DRIVE C:
echo -
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
cls
title DEEP VIRAL INFECTION!
echo -
echo CONTENTS OF HARD-DRIVE C: ERASED
echo -
pause
cls
echo -
echo SCANNING...
echo -
title SCANNING...
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
dir /s "C:\program files\"
:end1
cls
title DEEP VIRAL INFECTION!
echo -
echo 0.00 PERCENT OF HARD-DRIVE INFECTED
echo -
pause
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
echo ERROR
pause
cls
title SYSTEM FAILURE
color 17
echo ERROR!
echo -
echo VISUAL MEMORY LOST!
echo -
echo RAM LOST!
echo -
echo CORE PROCESSOR FAILING...
echo -
echo TOTAL SYSTEM CRASH IMMINENT!
echo -
echo -
pause
cls
echo -
echo -
echo -
echo SHUTDOWN COMPUTER NOW TO AVOID RISK OF FIRE!
echo -
echo -
echo -
pause
cls
echo -
echo -
echo -
echo SEEK PROFESSIONAL HELP IMMEDIATLY TO PREVENT FURTHER DAMAGE!
echo -
echo -
echo -
pause
start shutdown /s /t 60 /c "SYSTEM FAILURE<SHUTTING DOWN TO AVOID FURTHER DAMAGE!"
multiple dir lines are to give the effect of smth actually happening

There is no way to avoid that the cmd.exe session be closed when the user press the X button, but your Batch file can start a second cmd.exe session via start command and restart it again as soon as it terminates. If the window size of both the initial and second cmd.exe sessions are adjusted properly, you will get the desired effect.
#echo off
if "%1" equ "Restarted" goto %1
:again
echo N|start "" /WAIT cmd.exe /C "%~F0" Restarted > NUL
goto :again
:Restarted
echo I am a virus!
:loop
echo You can't close me!
timeout /T 1 > NUL
goto loop

Also, you were worried about losing the virus effect. Heres a way to make that not happen
Make another Notepad document and put,
start C:\Users\%username%\Documents\The_Name_Of_Virus
start C:\Users\%username%\Documents\The_Name_Of_Virus
start C:\Users\%username%\Documents\The_Name_Of_Virus
start C:\Users\%username%\Documents\The_Name_Of_Virus
start C:\Users\%username%\Documents\The_Name_Of_Virus
pause
Replace The_Name_Of_Virus with the file name of the batch file.
Doing that tells the computer to open the file 5 times. Then if someone closes one of them and it restarts the code, there are still 4 left that are still going. Making it run 5 batch files at the same time will slow your system down a bit. The %username% command uses the username so you do not need to replace %username% with your PC username.
Someone please correct me if I got anything wrong (I don't think I did).
Also, I think you should only put 1 dir command in there because on computers with a lot of filled memory (like mine), it will take a long time to go through every file. I have about 400GB filled on my computer and it took 15mins just to finish the first block of dir commands.

Well instead of deleting task mgr you could just kill taskmgr and then rename it to say nottaskmgr.exe and after the prank thing is done just kill taskmgr and rename it back to taskmgr.exe

Instead of putting "pause" at the end of each speech part you can put
ping -n 2 localhost >nul
That gives it a small delay before moving on the next part.
It basically just tells the system to ping itself and depending on your computer that will take a different amount of time. The 2 is telling the system to ping itself 2 times.

You could copy your .Bat file source and re-create it in a command prompt applications, this will require Visual Studio Community or better.
You can remove this windows Top-Bar utilities through the application frames Properties.
(Use the property tab for this)
You could also make a simple prank virus using a regular windows form application by using the following code with a looped (copy 'n paste) prompt.
MessageBox.Show("message", title);
I hope this helped you.
Yours sincerely,
OTA

Related

Devenv command line switches error

I have a simple solution which contains next to class projects also setup projects (extension installed in VS: vdproj).
Facing strange behaviour doing the following:
Open solution in VS2013 -> kick off rebuild -> no errors.
Create a small batch file:
CALL "%VS120COMNTOOLS%vsvars32.bat"
DEVENV "D:\Source\Solution.sln" /Rebuild "Debug|Any CPU" 1>NUL 2>&1
IF ERRORLEVEL 1 GOTO Error
IF ERRORLEVEL 0 GOTO Yeah
:Error
COLOR c
Echo.
Echo end %date% - %time%
Echo Failed!
PAUSE
:Yeah
Echo.
PAUSE
Run this batch file and the errorlevel is not zero
Changed now inside the batch file the devenv action to the following:
DEVENV "D:\Source\Solution.sln" /Clean "Debug|Any CPU" 1>NUL 2>&1
DEVENV "D:\Source\Solution.sln" /Build "Debug|Any CPU" 1>NUL 2>&1
Run this batch file and the errorlevel is zero
The strange thing is that without output redirection I do also not get any errors while running the batch with the rebuild action active.
Any suggestions why I do get a different behaviour?
In the first case you are doing a Rebuild. In the second case you are doing a Clean and Build. Temporarily remove the 1>NUL 2>&1 and you should be able to see what the error is all about.
You might simplify things a bit and save the results like this. Then you can view the log file before you 'Press any key to continue' if you want.
CALL "%VS120COMNTOOLS%vsvars32.bat"
SET "LogFile=%Temp%\BuildLog.txt"
IF EXIST "%LogFile%" DEL /F /Q "%LogFile%"
DEVENV "D:\Source\Solution.sln" /Rebuild "Debug|Any CPU" 1>"%LogFile%" 2>&1
IF ERRORLEVEL 1 (
COLOR c
Echo.
Echo end %date% - %time%
Echo Failed! View log file %LogFile% if you prefer. Then
)
PAUSE
IF EXIST "%LogFile%" DEL /F /Q "%LogFile%"

Batch Coding - Choose command not returning the correct answer

I am trying to create a batch file which has two options:
Create a series of folders with custom names (defined by variables inputted by the user)
OR
Create the same as before except also, once completed, automatically
copying all appropriate files to the appropriate folders in the
structure.
The idea is that with this batch file I could keep my film projects (As I am a freelance filmmaker working with my brother) in exactly the same folder structures across all 3 of our computers. AKA a uniform Project folder structure can be implemented with a simple double click and a few variables to fill in, while in the case of option 2 any files found on a specified SD Card are also moved to the appropriate folders within the structure.
The actual xcopy commands and mkdir commands etc. work exactly how they are supposed to.
Since the different computers will be allocating different drive letters depending on what is already attached to the computer before entering the SD Card into the card reader, I will never know what the drive letter of the SD Card will be (from which the footage and images will be loaded onto the computers).
For example:
One computer could have an external hard drive in (of which we have a few) at the time of the SD Card being plugged in, while another may have only the SD Card as an external device.
The code below is the complete .bat file including past code which I had tried but didn't work or needed to be excluded for some reason. I have some lines of code in comments so I know what I had tried in the past, these are obviously not meant to be used anymore.
:Menu
ECHO OFF
CLS
ECHO OFF
TITLE Saborknight Productions - Project Creator
ECHO.
ECHO ...............................................
ECHO PRESS the appropriate number to select your task, or 3 to EXIT.
ECHO ...............................................
ECHO.
ECHO 1 - Create Saborknight Default folder Hierarchy within a project folder
::(Disabled)ECHO 2 - Create Saborknight Default folder Hierarchy AND copy ALL files from SD Card to the appropriate folder
ECHO 3 - EXIT
ECHO.
ECHO WARNING - Option 2 will delete the files from the Recording Device automatically. Secure the device before proceeding!
ECHO.
ECHO.
CHOICE /c 123 /n
IF ERRORLEVEL 3 EXIT
IF ERRORLEVEL 2 GOTO :CREATE
IF ERRORLEVEL 1 GOTO :CREATE
::End of Menu
---------------------------------------------------------------------------------------------
:CREATE
::Creates DIR Folder Structure as per Saborknight Productions Standard
ECHO OFF
CLS
::Variables Descriptor
SET /P project_name=Enter the Project Name: || SET project_name=NothingChosen
If "%project_name%"=="NothingChosen" (
GOTO ERROR_PROJECT
) ELSE (
GOTO CREATOR
)
:ERROR_PROJECT
::If no Project Name is entered
ECHO Please enter the Project Name
GOTO CREATE
:CREATOR
::DIR Creator + Confirmation
::Videos DIR
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Footage
::Cut from above MKDIR -> \"Day 1"\%device_name%
::Images DIR
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Images\%device_name%
::Audio DIR -> Soundtracks
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Audio\Soundtracks
::Audio DIR -> Recordings
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Audio\Recordings
::Audio DIR -> Sound FX
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Audio\"Sound FX"
::Premier Project DIR
ECHO OFF
MKDIR D:\Dropbox\"Project Files"\"%project_name%"
ECHO The Folder Structure has been created
ECHO.
ECHO.
ECHO What would you like to do next?
Echo.
ECHO 1 - View Created Folder Structure
ECHO 2 - Go to Menu
ECHO 3 - EXIT
::Choice is invisible
CHOICE /c 123 /n
IF ERRORLEVEL 3 EXIT
IF ERRORLEVEL 2 GOTO MENU
IF ERRORLEVEL 1 GOTO VIEW
::End of CREATE
---------------------------------------------------------------------------------------------
:COPY
::Creates DIR Folder Structure as per Saborknight Productions Standard + Copying/Moving Files from a selected SD Card connected to the computer
ECHO OFF
CLS
:COPY_PROJECT
::Project Variable Descriptor
SET /P project_name=Enter the Project Name: || SET project_name=NothingChosen
If "%project_name%"=="NothingChosen" (
GOTO ERROR_COPY_PROJECT
) ELSE (
GOTO COPY_DEVICE_NAME
)
::If True, Process continues
:COPY_DEVICE_NAME
::Device Name Variable Descriptor
ECHO.
SET /P device_name=Enter the Name of the Recording Device: || SET device_name=NothingChosen
If "%device_name%"=="NothingChosen" (GOTO DAMN_DEVICE) ELSE (GOTO DEVICE_DIR)
:DEVICE_DIR
::Device DIR Variable Descriptor
ECHO.
::Selecting the location of the SD Card of the Recording Device + Confirmation
ECHO Copy files from drive: E, F, G, H or I?
SET _drive=G
::SETLOCAL EnableDelayedExpansion
::CHOICE /c fgehi
::IF ERRORLEVEL 5 SET _drive=I
::IF ERRORLEVEL 4 SET _drive=H
::IF ERRORLEVEL 3 SET _drive=G
::IF ERRORLEVEL 2 SET _drive=F
::IF ERRORLEVEL 1 SET _drive=E
ECHO.
ECHO You have selected drive %_drive%:
ECHO.
::DIR Creator + Confirmation -> Only if Device Drive is successfully selected
::Videos DIR
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Footage\"Day 1"\"%device_name%"
::Images DIR
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Images\"%device_name%"
::Audio DIR -> Soundtracks
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Audio\Soundtracks
::Audio DIR -> Recordings
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Audio\Recordings
::Audio DIR -> Sound FX
ECHO OFF
MKDIR D:\"Movie Projects"\"%project_name%"\Audio\"Sound FX"
::Premier Project DIR
::ECHO OFF
::(Disabled for Testing)MKDIR D:\Dropbox\"Project Files"\"%project_name%"
ECHO.
CHOICE /c YN /m "Would you like files to be deleted automatically from the device? Press Y=Yes or N=No"
IF ERRORLEVEL 2 GOTO NO_DELETE
IF ERRORLEVEL 1 GOTO DELETE
:NO_DELETE
::No Deletion once Copied from Device
::For Copying Videos
ECHO.
ECHO Copying Videos
XCOPY %_drive%:\DCIM\ "D:\Movie Projects\"%project_name%"\Footage\"Day 1"\"%device_name%"\" *.MOV *.mp4 /V /-Y
::COPY %_drive%:\DCIM\ "D:\Movie Projects\"%project_name%"\Footage\"Day 1"\"%device_name%"\" *.MOV *.mp4
::ROBOCOPY %_drive%:\DCIM "D:\"Movie Projects"\"%project_name%"\Footage\"Day 1"\"%device_name%"\*" *.mov *.mp4 /mir /copy:DATO /np /eta /log+:"Log - Footage CopyOnly.txt" /nosd /nodd
PAUSE
::For Copying Images
ECHO.
ECHO Copying Images
XCOPY %_drive%:\DCIM\ "D:\Movie Projects\"%project_name%"\Images\"%device_name%"\" *.MOV *.mp4 /V /-Y
::COPY %_drive%:\DCIM\*.jpg;*.png;*.cr2 "D:\Movie Projects\"%project_name%"\Images\"%device_name%"\" /V /-Y
::ROBOCOPY %_drive%:\DCIM "D:\"Movie Projects"\"%project_name%"\Footage\"Day 1"\"%device_name%"" *.jpg *.png *.cr2 /copy:DATO /mir /np /eta /log+:"Log - Images Copy Only.txt" /nosd /nodd
PAUSE
GOTO SUCCESS_MSG
:DELETE
::Copying with Automatic Deletion once Copied
::For Copying and Deleting Videos
ECHO Copying and Deleting Videos
MOVE %_drive%:\DCIM\*.mov;*.mp4 D:\"Movie Projects"\"%project_name%"\Footage\"Day 1"\"%device_name%"\ /-Y
::ROBOCOPY %_drive%:\DCIM D:\"Movie Projects"\"%project_name%"\Footage\"Day 1"\"%device_name%" *.mov *.mp4 /mov /copy:DATO /np /eta /log+:"Log - Footage Copy Delete.txt" /nosd /nodd
PAUSE
::For Copying and Deleting Images
ECHO Copying and Deleting Images
MOVE %_drive%:\DCIM\*.jpg;*.png;*.cr2 D:\"Movie Projects"\"%project_name%"\Images\"%device_name%"\ /-Y
::ROBOCOPY %_drive%:\DCIM D:\"Movie Projects"\"%project_name%"\Images\"%device_name%" *.jpg *.png *.cr2 /mov /copy:DATO /np /eta /log+:"Log - Images Copy Delete.txt" /nosd /nodd
PAUSE
GOTO SUCCESS_MSG
:SUCCESS_MSG
::Only if all Copying/Moving and DIR Creation Processes are Completed Successfully
ECHO.
ECHO The Folder Structure has been created and files copied/moved
ECHO.
ECHO.
ECHO What would you like to do next?
Echo.
ECHO 1 - View Created Folder Structure
ECHO 2 - Go to Menu
ECHO 3 - EXIT
::Choice is invisible
CHOICE /c 123 /n
IF ERRORLEVEL 3 EXIT
IF ERRORLEVEL 2 GOTO MENU
IF ERRORLEVEL 1 GOTO :VIEW
:DAMN_DEVICE
ECHO.
ECHO Please enter the Device Name, Re-entering the Project Name
ECHO.
GOTO COPY
:ERROR_COPY_PROJECT
::If no Project Name is entered
ECHO.
ECHO Please enter the Project Name
ECHO.
GOTO COPY_PROJECT
ENDLOCAL
::End Of COPY
---------------------------------------------------------------------------------------------
:VIEW
ECHO OFF
CLS
TREE D:\"Movie Projects"\"%project_name%"
ECHo.
ECHO Press any key to return to Menu
ECHO.
PAUSE
GOTO MENU
::End of VIEW
The Problem
In this part of the code, the CHOOSE command wont choose the correct choice:
#ECHO OFF
CHOICE /c fgehi
IF ERRORLEVEL 5 SET _drive=I
IF ERRORLEVEL 4 SET _drive=H
IF ERRORLEVEL 3 SET _drive=E
IF ERRORLEVEL 2 SET _drive=G
IF ERRORLEVEL 1 SET _drive=F
Pause
ECHO.
ECHO You have selected drive %_drive%:
ECHO.
Pause
The Evidence of the Problem being a problem
I tested the Batch file on two separate machines (One by remote access so that the two screens lay side by side) and can be viewed here: Image of the Problem being a problem...
Apologies for the dirtiest code in history with a complete overuse of comments. This was supposed to be a one night project which has turned into a month long project and I still haven't solved it!
Even a programming friend of mine cannot explain why it wont work.
All help much appreciated in advance!!!
Also any alternative suggestions to complete the described tasks above are definitely welcome, I love learning new code!
Saborknight
Your program fail because IF ERRORLEVEL n ... "execute the command if the errorlevel is GREATER OR EQUAL than the number given", that is, you placed the IF commands in the opposite order. This works correctly:
#ECHO OFF
CHOICE /c fgehi
IF ERRORLEVEL 1 SET _drive=F
IF ERRORLEVEL 2 SET _drive=G
IF ERRORLEVEL 3 SET _drive=E
IF ERRORLEVEL 4 SET _drive=H
IF ERRORLEVEL 5 SET _drive=I
Pause
ECHO.
ECHO You have selected drive %_drive%:
ECHO.
Pause
May I suggest you a different, simpler method?
#ECHO OFF
SET option=0FGEHI
CHOICE /c fgehi
CALL SET _drive=%%option:~%ERRORLEVEL%,1%%
ECHO.
ECHO You have selected drive %_drive%:
ECHO.
Pause
As documented here: http://www.robvanderwoude.com/choice.php
By the way, in Windows NT 4 this won't work, since the SET command itself will set an errorlevel (usually 0)!
However, Windows NT makes it easy by storing the latest errorlevel in the environment variable ERRORLEVEL
This works for me:
#ECHO OFF
CHOICE /c fgehi
IF %ERRORLEVEL% EQU 5 SET _drive=I
IF %ERRORLEVEL% EQU 4 SET _drive=H
IF %ERRORLEVEL% EQU 3 SET _drive=E
IF %ERRORLEVEL% EQU 2 SET _drive=G
IF %ERRORLEVEL% EQU 1 SET _drive=F
Pause
ECHO.
ECHO You have selected drive %_drive%:
ECHO.
Pause
Unless you know the proper ritual to ask the Microsoft gods for forgiveness, I would recommend you stay away from batch, it is a lot of trouble.
Even PowerShell is much less of a hassle.

Is my batch file compatible with all computers?

Will this work on Windows 8 and always work? I've tested it on Windows 7 but I'm not sure... I had a friend test it and he said that it coudn't find the correct path but I checked and the syntax of the commands is the same and I don't know why there'd be a problem. This is assuming %USERPROFILE%\Documents\My Games\Terraria\Players and %USERPROFILE%\Google Drive exists already
#echo off
echo Administrative permissions required. Detecting permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
echo Success: Administrative permissions confirmed.
) else (
echo Failure: Current permissions inadequate. Please run as administatior.
pause >nul
exit
)
echo ---------------------------------------------
echo Below enter "S" for simple install type or "A" for avanced install type.
echo (Simple is recommended, only use advanced if you know what your doing!)
echo ---------------------------------------------
set /p option=Enter:
if /i "%option%"=="S" goto simple
if /i "%option%"=="A" goto advanced
echo Your entry did not match available options. Try again.
pause >nul
exit
:simple
mklink /d "%USERPROFILE%\Google Drive\Terraria" "%USERPROFILE%\Documents\My Games\Terraria\Players"
cd %USERPROFILE%\Google Drive\Terraria\
copy /y NUL marker >nul
cd %USERPROFILE%\Documents\My Games\Terraria\Players
if exist marker (
echo Validation of installation complete. Symbolic link functional.
del marker
) else (
echo SOMETHING WENT WRONG!!!!!!!!
)
echo ==============
echo You Selected Simple. & echo.If there are no errors above, your installation should be complete.
echo ==============
pause >nul
exit
:advanced
mkdir "%USERPROFILE%\Google Drive\Terraria"
mklink /d "%USERPROFILE%\Google Drive\Terraria\Players" "%USERPROFILE%\Documents\My Games\Terraria\Players"
cd %USERPROFILE%\Google Drive\Terraria\Players
copy /y NUL marker >nul
cd %USERPROFILE%\Documents\My Games\Terraria\Players
if exist marker (
echo Validation of installation complete. Symbolic link functional.
del marker >nul
) else (
echo SOMETHING WENT WRONG!!!!!!!!
)
echo ==============
echo You Selected Advanced. & echo.If there are no errors above, your installation should be complete.
echo ==============
pause >nul
exit
If delivered that all paths exist....
mklink command was introduced in Vista so the script won't work on XP/2003.

Making a Batch File Faster

I have this little piece of code for cracking WinRAR archive passwords using a word list file.
title RAR Crack v_2.0
echo off
color f0
set dest=%temp%\%random%
md %dest%
cls
echo.
echo -----------------------------------------
echo ^| RAR CRACK v_2.0 - BY NOOR (#NullByte) ^|
echo -----------------------------------------
echo.
echo Drag and drop the archive to this window and press ENTER
set /p arch=
echo.
echo Drag and drop the wordlist to this window and press ENTER
set /p word=
cls
echo.
echo Starting Process . .
timeout /t 2 /nobreak>nul
color f5
cls
echo.
echo Starting Process . . .
timeout /t 1 /nobreak>nul
:start
for /F %%A in (%word%) do call :process %%A
color 0c
cls
echo.
echo -----------------------------------------
echo ^| RAR CRACK v_2.0 - BY NOOR (#NullByte) ^|
echo -----------------------------------------
echo.
echo.
echo PASSWORD NOT FOUND!
echo.
echo.
echo Author: Hussain Noor Mohamed (#NullByte)
echo E-mail: noor.xbyte#mail.com
echo.
echo Your suggestions are of great value!
pause>nul
exit
:process
cls
echo.
echo Current Password: %1
unrar e -inul -p%1 "%arch%" "%dest%"
if /i %errorlevel% equ 10 goto error
if /i %errorlevel% equ 0 goto finish %1
exit /b
:finish
color 0a
cls
echo.
echo -----------------------------------------
echo ^| RAR CRACK v_2.0 - BY NOOR (#NullByte) ^|
echo -----------------------------------------
echo.
echo.
echo PASSWORD FOUND!
echo.
echo ARCHIVE : %arch%
echo WORDLIST : %word%
echo PASSWORD : %1
echo.
echo.
echo Author: Hussain Noor Mohamed (#NullByte)
echo E-mail: noor.xbyte#mail.com
echo.
echo Your suggestions are of great value!
pause>nul
exit
:error
color ce
cls
echo.
echo "%arch%" is not a valid rar file!
pause>nul
exit
The problem is that it is not that fast. (It is fast, but does not meet my expectations.) It would be really grateful if you people can suggest a way to make the program faster.
P.S Please don't copy my source code!!
As Stephan said, most of your CPU time goes into unrar running. Here are some things that I believe could help you.
You run unrar on all files. If your archive contains large/many files and you know they all have the same password (which is the usual case), then you can save some time by doing this: get the name of the first file in the archive (unrar lb ....) and only test that one (unrar t ... FILE). You should get the file name only once, before starting to test passwords.
You are running unrar sequentially, which means you do not take advantage of modern CPU features (like multi-core/threading). Most password crackers start multiple parallel processes/threads to test more passwords simultaneously, thus increasing the throughput. This is harder to do with batch files though.
You run unrar in extract mode, which assumes some disk activity (at minimum opening and closing a file). You could save some extra CPU ticks if you run it in test mode (unrar t), but this would be minimal.
Because the files don't change and you use them intensively, Windows will cache unrar and your archive (if possible) in RAM, so a RAM disk will provide little benefit to you (see also #3).
I believe 1 and 2 are the most important issues that would gain you some speed. In any case, cracking passwords is a time consuming task by itself.

Copy command not working "Batch Programming"

Want to make a installer for a game i play:
#echo off
echo.
echo Choose One
echo __________
echo.
echo 32
echo.
echo 64
echo.
echo Idk
echo.
echo __________
echo.
echo.
set/p bit=
goto %bit%
:32
xcopy "warcraft3" C:\Program Files
pause
goto done
:64
xcopy "warcraft3" C:\Program Files(x86)
pause
goto done
:idk
xcopy "warcraft3" C:\Program Files
pause
goto done
:done
the "warcraft3" is a folder not a zip or anything, it says it cant find the specified file.
Need quotes around folders with spaces
xcopy "warcraft3" "C:\Program Files\"
also good practice to put a trailing slash on destination folders.

Resources