techPowerUp! Forums

Go Back   techPowerUp! Forums > Software > Programming & Webmastering

Reply
 
Thread Tools
Old Jan 15, 2008, 10:06 PM   #1
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.80/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Batch File Recognition

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?
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 15, 2008, 10:09 PM   #2
Random Murderer
3500 Posts
 
Random Murderer's Avatar
 
Join Date: Dec 2006
Location: Florida, where it's hot as hell.
Posts: 4,094 (1.73/day)
Thanks: 1,003
Thanked 677 Times in 507 Posts

System Specs

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~
__________________
“People just need a reason to live. Some peoples reason is to bitch on the Internet. W1zz is just giving these sad souls a reason to live. Hes like a saint. Saint W1zzard.” -TheMailMan78
Mars: Apparently I have been there before, but I don't recall.
Not all who wander are lost...
Random Murderer is offline  
Reply With Quote
Old Jan 16, 2008, 12:56 PM   #3
adrianx
200 Posts
 
Join Date: Jan 2008
Location: Bucharest ROMANIA
Posts: 321 (0.16/day)
Thanks: 2
Thanked 25 Times in 20 Posts
Send a message via Yahoo to adrianx

System Specs

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...
adrianx is offline  
Reply With Quote
The Following User Says Thank You to adrianx For This Useful Post:
Old Jan 16, 2008, 02:06 PM   #4
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.80/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Thanks AdrianX, I will try that.
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 16, 2008, 04:51 PM   #5
Random Murderer
3500 Posts
 
Random Murderer's Avatar
 
Join Date: Dec 2006
Location: Florida, where it's hot as hell.
Posts: 4,094 (1.73/day)
Thanks: 1,003
Thanked 677 Times in 507 Posts

System Specs

Quote:
Originally Posted by adrianx View Post
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...
lol, it's been years since i've programmed using BASIC, it was just the first thing that came to mind.
__________________
“People just need a reason to live. Some peoples reason is to bitch on the Internet. W1zz is just giving these sad souls a reason to live. Hes like a saint. Saint W1zzard.” -TheMailMan78
Mars: Apparently I have been there before, but I don't recall.
Not all who wander are lost...
Random Murderer is offline  
Reply With Quote
Old Jan 17, 2008, 12:03 AM   #6
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.80/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Quote:
Originally Posted by adrianx View Post
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...
Ya im writing it in a batch file, not basic... basic might be a bit easier.
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 17, 2008, 06:36 AM   #7
adrianx
200 Posts
 
Join Date: Jan 2008
Location: Bucharest ROMANIA
Posts: 321 (0.16/day)
Thanks: 2
Thanked 25 Times in 20 Posts
Send a message via Yahoo to adrianx

System Specs

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.
adrianx is offline  
Reply With Quote
Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with simple batch file djmonson General Software 15 Jun 28, 2007 02:47 AM
Random Restars - > Video Card - > PSU TrAiN^WrEcK General Hardware 37 May 8, 2007 02:05 PM
Problem with my HP DVD Burner Madkat General Hardware 0 Aug 19, 2006 04:33 PM
having problems with cod 2 MATTB25 Games 12 Jul 19, 2006 01:45 PM
Some tutorials needed thetarget Overclocking & Cooling 57 Apr 7, 2006 02:28 AM


All times are GMT. The time now is 11:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
no new posts