Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Zip Archives + Delete Contents...IF
Old 08-04-2008, 06:10 AM Zip Archives + Delete Contents...IF
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
Hi,

I have a bunch of zip files in which some of them contain a text file, and some of the zip files do not contain a text file...How can I do a batch file that I can run in the same folder as the zip files that will delete the zip file ONLY IF that text file doesn't exist?

Thanks alot!
-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-04-2008, 06:05 PM Re: Zip Archives + Delete Contents...IF
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
A batch file process can't open the zip and check the content.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-04-2008, 07:22 PM Re: Zip Archives + Delete Contents...IF
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
You could do this with bash (pretty easy) but, a windows batch file.... I don't know
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 08-04-2008, 09:14 PM Re: Zip Archives + Delete Contents...IF
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by chrishirst View Post
A batch file process can't open the zip and check the content.
That's odd, I have batch file that will rename a file inside a zip to another type and it works fine. I don't see how a file couldn't be modified in another way such as deleting the first line of the text file...

Ex: The Zip contains 2 files and one is the text file...The script would then delete the first line in the text file and save it.

-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 08-06-2008, 06:39 AM Re: Zip Archives + Delete Contents...IF
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
I have batch file that will rename a file inside a zip to another type and it works fine
If you mean as in this thread -> http://www.webmaster-talk.com/coding...ding-help.html

The batch file isn't opening the zip, you are using the batch file to open winrar in command line mode and it is Winrar that does the work.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-06-2008, 09:05 PM Re: Zip Archives + Delete Contents...IF
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
that is exactly what I mean, sorry for not posting clearly. But yes, that's what I mean.

Thanks alot!
-Brian
Brian07002 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Zip Archives + Delete Contents...IF
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23212 seconds with 12 queries