PDA

View Full Version : Batch File Recognition


PVTCaboose1337
01-15-2008, 10:06 PM
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
01-15-2008, 10:09 PM
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
01-16-2008, 12:56 PM
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 :D 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
01-16-2008, 02:06 PM
Thanks AdrianX, I will try that.

Random Murderer
01-16-2008, 04:51 PM
random murderer.... nice basic code :D 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... :)

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

PVTCaboose1337
01-17-2008, 12:03 AM
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 :D 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... :)

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

adrianx
01-17-2008, 06:36 AM
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.