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
Solved

batch script, bypass any error and move forward

Posted on 2012-03-12
1
284 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
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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.

860 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