Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Batch programming question

Posted on 1998-07-23
8
Medium Priority
?
225 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
Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

 

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

Technology Partners: 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!

Question has a verified solution.

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

New style of hardware planning for Microsoft Exchange server.
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

610 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