?
Solved

Batch programming question

Posted on 1998-07-23
8
Medium Priority
?
222 Views
Last Modified: 2010-04-26
Hi,

I'm trying to teach myself simple batch programming and had a few questions:

1) I was writing a simple batch file to create a self-extracting archive and here's the script:

cd zip
pkzip zipped.zip *.*
zip2exe zipped.zip
move zipped.exe c:\_aaZIPPED\
erase *.*
cd ..
exit

The problem I'm having is making it two do things:
a) it reacts to the "erase *.*" by asking me a question. How do I get it to proceed with "yes to all"?

b) how do I make it exit the MSDos program after executing the batch program?

2)  Is there any good source to learn the simpler elements of batch programming?

thanks,

Priyo
0
Comment
Question by:priyo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 2

Expert Comment

by:SirCaleb
ID: 1019957
Did you try just adding a "y" in the spot where it prompts you?
0
 

Accepted Solution

by:
Tinkerer earned 200 total points
ID: 1019958
change " rase *.*" to "echo Y | erase *.*"
That will echo a Y to answer the question "all files in this directory will be deleted! are you sure?"

if youy are running it through win95, you have to set it to exit on finish in the program properties.. right click on the batch file, click on properties, click on the program tab, and click close on exit...
0
 
LVL 2

Expert Comment

by:SirCaleb
ID: 1019959
Tinkerer...how do you may that symbol after the echo Y  ??
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:priyo
ID: 1019960
thanks much -- it worked; any suggestions on a good source to pick up the finer points of batch programming?

Thanks,

Priyo
0
 

Expert Comment

by:Tinkerer
ID: 1019961
Example..

   cd zip
   pkzip zipped.zip *.*
   zip2exe zipped.zip
   move zipped.exe c:\_aaZIPPED\
   echo Y | erase *.*
   cd ..
   exit

The Pipe symbol is usually above the \ symbol
(shift + backslash)

Honestly, I don't know any good resources on the web, I would recommend a half price book store, older books, ya know..
http://users.demag.rwth-aachen.de/Donald/nt/faq/ntfaq/batch.html

0
 

Expert Comment

by:Tinkerer
ID: 1019962
Hey! Hey!

Here ya go!!

This is pretty good..

http://www.slip.net/~batchman/support.html
0
 

Author Comment

by:priyo
ID: 1019963
Thanks a lot pal!!

later,

Priyo
0
 

Expert Comment

by:ey143
ID: 1019964
Try this book

Microsoft Quick Reference - MS Dos Batch Files

by Kris Jamsa

it's old, around early 90s, but I found an unused copy in my bookshelf, pretty useful stuff, far more complex for me to understand though!

Dan
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question