Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

batch script, bypass any error and move forward

Posted on 2012-03-12
1
Medium Priority
?
288 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:
Meir Rivkin 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

618 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