|
-
Sep 9th, 2004, 02:28 AM
#1
Thread Starter
Member
Batch File/Language Help [Resloved]
Hi,
I am doing batch programming now. Currently, I am doing a if/else clause. I want to ask 2 things. 1st, if i want to do multiple things in the else command, how do i put them together? Using "and"? for example:
ELSE (
net send 192.168.100.78 configuration 1.1 download failed
and
start mailto:[email protected]?subject=Error^&body=Download%%20Has%%20Failed.%%20Please%%20Try%%20To%%20Down load%%20The%%20Configurations%%20Again.
)
The 2nd thing is how do I create txt files using batch commands? Like I want to create a textfile name error.txt in the else clause when the if condition is not met.
Any help is greatly appreciated, thank you.
Last edited by iori85z; Sep 26th, 2004 at 08:56 PM.
-
Sep 9th, 2004, 02:41 AM
#2
Here is a start
from a thread
not my own...
-
Sep 9th, 2004, 02:54 AM
#3
Thread Starter
Member
thanks, but b4 posting this thread I have spend a long time searching for information on this in google. This webpage I have come across it b4. It is useful in the sense tat it teaches me more syntax and basics but it couldn't help my coding much. But thanks anyway.
-
Sep 9th, 2004, 10:25 AM
#4
Retired VBF Adm1nistrator
To do multiple actions, just put the next command on the next line. But be careful, using the IF branches will only work on post W2K machines. Otherwise you'll need to jump to a label, perform your commands and jump back again.
Regarding outputting to a file, you can use the pipe character > to output. So, e.g. :
Code:
@echo off
@echo This is a test > c:\somefile.txt
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|