1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Batch File Recognition

Discussion in 'Programming & Webmastering' started by PVTCaboose1337, Jan 15, 2008.

  1. PVTCaboose1337

    PVTCaboose1337 Graphical Hacker

    Joined:
    Feb 1, 2006
    Messages:
    9,513 (3.17/day)
    Thanks Received:
    1,142
    Location:
    San Antonio, Texas
    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?
  2. Random Murderer

    Random Murderer The Anti-Midas

    Joined:
    Dec 6, 2006
    Messages:
    6,257 (2.32/day)
    Thanks Received:
    984
    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~
  3. adrianx New Member

    Joined:
    Jan 9, 2008
    Messages:
    324 (0.14/day)
    Thanks Received:
    22
    Location:
    Bucharest ROMANIA
    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 says thanks.
  4. PVTCaboose1337

    PVTCaboose1337 Graphical Hacker

    Joined:
    Feb 1, 2006
    Messages:
    9,513 (3.17/day)
    Thanks Received:
    1,142
    Location:
    San Antonio, Texas
    Thanks AdrianX, I will try that.
  5. Random Murderer

    Random Murderer The Anti-Midas

    Joined:
    Dec 6, 2006
    Messages:
    6,257 (2.32/day)
    Thanks Received:
    984
    lol, it's been years since i've programmed using BASIC, it was just the first thing that came to mind.
  6. PVTCaboose1337

    PVTCaboose1337 Graphical Hacker

    Joined:
    Feb 1, 2006
    Messages:
    9,513 (3.17/day)
    Thanks Received:
    1,142
    Location:
    San Antonio, Texas
    Ya im writing it in a batch file, not basic... basic might be a bit easier.
  7. adrianx New Member

    Joined:
    Jan 9, 2008
    Messages:
    324 (0.14/day)
    Thanks Received:
    22
    Location:
    Bucharest ROMANIA
    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.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page