Welcome Guest ( Log In | Register )

Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Spyware, virus, trojan, fake security or privacy alerts? Read the malware cleaning guide.
      
 
Reply to this topicStart new topic
Batch file question
Fredil
post Aug 9 2007, 11:07 AM
Post #1


Trusted Helper
Group Icon
Posts: 1,979
From: Wait, wait, I know this!
OS: Windows XP Professional SP2



Is it possible to have a batch file display a message if two conditions are met? For instance...

CODE
@ECHO OFF
IF EXIST C:\test.txt AND C:\test.exe GOTO blah
:blah
ECHO blah
EXIT


returns the error "AND" is not a recognized...." We get the same error message using the OR command. It's possible to make it using GOTOs

CODE
@ECHO OFF
IF EXIST C:\test.txt GOTO test1
ECHO test.txt does not exist
GOTO exit
:test1
IF EXIST C:\test.exe GOTO blah
ECHO test.txt exist, test.exe does not
:exit
ECHO press any key to exit
PAUSE>NUL
:blah
ECHO blah


but it is unnecessarily tedious. So can anyone help me make it somewhat easier?
Go to the top of the page
 
+Quote Post
don77
post Aug 9 2007, 06:31 PM
Post #2


Malware Expert
Group Icon
Posts: 18,682
From: Boston Ma.
OS: XP Pro,ME, 98



Is this purposely in the XP forum ?
Go to the top of the page
 
+Quote Post
Fredil
post Aug 9 2007, 06:34 PM
Post #3


Trusted Helper
Group Icon
Posts: 1,979
From: Wait, wait, I know this!
OS: Windows XP Professional SP2



Well, it had to do with XP... it would be easier if I was running MS-DOS smile.gif

Truth be told, I couldn't find a better forum for it.
Go to the top of the page
 
+Quote Post
don77
post Aug 9 2007, 06:35 PM
Post #4


Malware Expert
Group Icon
Posts: 18,682
From: Boston Ma.
OS: XP Pro,ME, 98



QUOTE
Truth be told, I couldn't find a better forum for it.


Really ?
Go to the top of the page
 
+Quote Post
Fredil
post Aug 9 2007, 06:38 PM
Post #5


Trusted Helper
Group Icon
Posts: 1,979
From: Wait, wait, I know this!
OS: Windows XP Professional SP2



Oops... there seems to be a forum known as "Software development"... Would you be so kind as to move this thread for me?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies / Views Topic Information
No New Posts   3 / 1,162 4th August 2008 - 08:55 AM
bombasos2 started - last by Swandog46
No New Posts   5 / 1,132 18th August 2008 - 11:43 AM
AliL started - last by Ax238
No New Posts   4 / 295 16th October 2008 - 05:31 PM
pr0n started - last by pr0n
No New Posts 0 / 22 Yesterday, 06:51 PM
Dimension started - last by Dimension

RSS Time is now: 21st November 2008 - 06:12 PM
Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk.