General discussion

help with a bat file

i have a bat file that runs pkzip to zip up files from a particular directory and move them somewhere else. I have this working by specifying the exact directory in the bat file but rather than have multiple bat files I want to know if i can modify the bat file to pick up the name of the directory the files are in and use that name to name the zip file.

eg i have files under d:\sys\database1\ and d:\sys\database2\

i would like to run a bat file that zips up the contents of database 1 and names the file database1.zip.

Also when picking up files to zip up is it possible to exclude a file type? I would like to zip up everything apart from a certain file type?

Discussion is locked

Follow
Reply to: help with a bat file
PLEASE NOTE: Do not post advertisements, offensive materials, profanity, or personal attacks. Please remember to be considerate of other members. If you are new to the CNET Forums, please read our CNET Forums FAQ. All submitted content is subject to our Terms of Use.
Reporting: help with a bat file
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Comments

CNET Forums

Forum Info