Solved

batch script, bypass any error and move forward

Posted on 2012-03-12
1
280 Views
Last Modified: 2012-03-27
Is there anything I can add to this to tell the batch to continue even if there is an error, i.e., the path is not found??  I don't mind an echo statement as long as the batch does not stop moving.  Also, I am not sure if using >NUL after these lines do anything.  If that is the case I will remove.  

@echo off
del /s /q "%programfiles%\bquest\*.tmp" >NUL
del /s /q "%programfiles(x86)%\bquest\*.tmp" >NUL
cls
exit
0
Comment
Question by:icecom4
1 Comment
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
Comment Utility
i run the script and even if there's an error in the first line it continues to the second line and doesn't exit.
if u remove the cls and exit lines of code (the bottom 2 lines) and run the script in a command window, you'll see that both deletion lines are run regardless any error triggered.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now