Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 25th, 2005, 05:12 PM
Abatch User Abatch User is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 Abatch User User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 33 sec
Reputation Power: 0
Question Ignore errors in batch files?

I am trying to write a batch file that will start at Drive A, search for files with the extension of FDB and make a list of those filenames and paths, and save to a text file. If there is no disk or flash drive, I prefer it continue, not stop with a fatal error.
Example:
A:
cd\
DIR *.FDB/S/B > C:\FDBDATA\ADATA.DAT
B:
cd\
DIR *.FDB/S/B > C:\FDBDATA\BDATA.DAT
C:
cd\
DIR *.FDB/S/B > C:\FDBDATA\CDATA.DAT

...and so on until Drive Z.

At the end of creating the files, I can combine them to make one data file. This is the file I am looking for.

My efforts fail when there is no floppy, flash, or pen diskette/drive in those letters. When there is no floppy/pen, I would prefer it just try the next letter and keep on going.

After creating those files, I can combine them and use them for a genealogy program. It would be nice if this would run minimized so a new user won't get stressed at seeing all the commands.

Any ideas please?

Thank you very much.

Abatch User

Reply With Quote
  #2  
Old September 2nd, 2010, 08:04 AM
ludwigvolcano ludwigvolcano is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2010
Posts: 1 ludwigvolcano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 25 sec
Reputation Power: 0
Try something like (for drive A)

Dir A:
If NOT errorlevel 1 Dir A: *.FDB/S/B > C:\FDBDATA\ADATA.DAT

This should only execute the Dir A: *.FDB/S/B > C:\FDBDATA\ADATA.DAT command if the drive exists. May need some tweaking.

Hope this helps

Ludwigvolcano


Quote:
Originally Posted by Abatch User
I am trying to write a batch file that will start at Drive A, search for files with the extension of FDB and make a list of those filenames and paths, and save to a text file. If there is no disk or flash drive, I prefer it continue, not stop with a fatal error.
Example:
A:
cd\
DIR *.FDB/S/B > C:\FDBDATA\ADATA.DAT
B:
cd\
DIR *.FDB/S/B > C:\FDBDATA\BDATA.DAT
C:
cd\
DIR *.FDB/S/B > C:\FDBDATA\CDATA.DAT

...and so on until Drive Z.

At the end of creating the files, I can combine them to make one data file. This is the file I am looking for.

My efforts fail when there is no floppy, flash, or pen diskette/drive in those letters. When there is no floppy/pen, I would prefer it just try the next letter and keep on going.

After creating those files, I can combine them and use them for a genealogy program. It would be nice if this would run minimized so a new user won't get stressed at seeing all the commands.

Any ideas please?

Thank you very much.

Abatch User

Reply With Quote
  #3  
Old September 6th, 2010, 06:27 AM
Schofield Bond Schofield Bond is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2010
Posts: 2 Schofield Bond Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 11 m 39 sec
Reputation Power: 0
re: Ignore errors in batch files?

Hello,

I think you can ignore errors in batch files by using proper code.

Thanks for providing information
John Farris
Comments on this post
f_nietzsche disagrees: by using proper code...you think? SPAM!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > Ignore errors in batch files?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap