?
Solved

batch script, bypass any error and move forward

Posted on 2012-03-12
1
Medium Priority
?
287 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
[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
1 Comment
 
LVL 42

Accepted Solution

by:
sedgwick earned 2000 total points
ID: 37713559
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

762 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