[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

batch script, bypass any error and move forward

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
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.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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
Course of the Month19 days, 13 hours left to enroll

872 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