# Batch File Recognition



## PVTCaboose1337 (Jan 15, 2008)

I really could not come up with a title, but what I want to do is say:

If FILE_A.bat sees FILE_B.bat, then FILE_A will execute code, and if FILE_A does not see FILE_B, then another type of code is executed.  Does anyone know how this can be done?


----------



## Random Murderer (Jan 15, 2008)

sounds like you need to throw in some BASIC.
10: If A then goto 30
20: If B then goto 50
30: ~code~
40: Skip 50
50: ~other code~


----------



## adrianx (Jan 16, 2008)

you want to write a batch file? or what?

you can write that in a .bat file
V1
If exist file1.bat...    

V2
IF NOT EXIST file1.bat....


you also can use the command prompt from you windows

START >>RUN >>>write command and press ENTER

then tipe  

IF /?

to display the help file for that command IF

will be very easy to help you ... but I must know what you want to do and what must do you batch file.

random murderer.... nice basic code  but... in BASIC...

with that... 
10 If A then goto 30
20 If B then goto 50
25 GOTO 10
30 ~code~
35 GOTO 100
40 Skip 50
50 ~other code~
100 EXIT

25 WILL CYCLING FOR LINE 10 AND 20 UNTIL ONE IS TRUE

35 WILL JUMP TO 100 WERE WILL EXIT FROM PROGRAM

SAME CAN BE 55 BUT IS FACULTATIVE, WITH OR WITHOUT THIS THE PROGRAM WILL EXIT (CONSIDERING THAT 55 GOTO 100 )

also the line 10 and 20 must have a logical operator (=, >,<, EXIST, ..)
samething like that ... 

if A=1 intruction... :then goto 30 (you also can make a macro instruction, more that one instraction to execute until run the THEN Goto command.

nice... day the basic days...


----------



## PVTCaboose1337 (Jan 16, 2008)

Thanks AdrianX, I will try that.


----------



## Random Murderer (Jan 16, 2008)

adrianx said:


> random murderer.... nice basic code  but... in BASIC...
> 
> with that...
> 10 If A then goto 30
> ...



lol, it's been years since i've programmed using BASIC, it was just the first thing that came to mind.


----------



## PVTCaboose1337 (Jan 17, 2008)

adrianx said:


> you want to write a batch file? or what?
> 
> you can write that in a .bat file
> V1
> ...



Ya im writing it in a batch file, not basic...   basic might be a bit easier.


----------



## adrianx (Jan 17, 2008)

I use batch file to take multiple log file from the network at the boot time and to test the existence of diferent spyware in a network. I know basic, batch and that is ~ all that I know for now, but I'm at university... I must learn more.


----------

