2

I am studying how to make simple virus (for Ethical Hacking in Virtual Computer)

This video gives demonstration, https://www.youtube.com/watch?v=vkxtOr2RLbY

In short, you create .bat file with following

@echo off
:A
start
goto :A

I cannot understand what

:A

is for.

I thought A: was floppy drive, which is no longer in use. But what is :A?

Kindly explain

1
  • This is not a security question, but a batch file language question. Migrating to SuperUser.
    – schroeder
    Feb 17, 2016 at 18:44

2 Answers 2

3
@echo off     -Turns off outputs within the CMD windows
:A            -Creates a new label we can go to later
start         -Opens a new command prompt window
goto :A       -Goes back to our label above

It would infinitely run the same start command, creating infinite CMD windows.

If, however, it had been A:, then the second line would attempt to go to the A: (A floppy drive perhaps), and the goto would just fail.

1

It's a label for the goto statement. Essentially you're marking that line as A and then the goto statement says "Go back to the line marked as A". Thus this creates an infinite loop.

Here's some more information: http://ss64.com/nt/goto.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .