1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Using set in CMD

Discussion in 'Windows XP' started by jpboyrox, Apr 6, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. jpboyrox

    jpboyrox Thread Starter

    Joined:
    Nov 22, 2009
    Messages:
    344
    I am trying to get my head round the set command, why does this not work:

    Code:
    if %delete%==y goto y
    if %delete%==n goto n
    
    :y
    cls 
    rd /s/q FOLDER
    cls
    echo Files Deleted!
    pause
    
    :n
    cls
    echo Files not deleted
    pause
    
    
    If 'n' is selected it skips :y but if 'y' is selected it runs :y and then :n
    Why is that and how can i sort it out?
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    What does this have to do with the set command? You are not even using it.

    Batch is a sequential processing scripting language. If you need it to bypass the :N subroutine then you need to put in another goto after your :Y subroutine finishes.

    goto :EOF (This would exit the batch file.)
     
  3. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    I see you marked this solved but I was hoping for a response to my question.
     
  4. jpboyrox

    jpboyrox Thread Starter

    Joined:
    Nov 22, 2009
    Messages:
    344
    oh right, I actually can't remember I looked it up on youtube. I thinkot was called the 'set' command in the title. Don't know why
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved Using
  1. SkipRinPerth
    Replies:
    1
    Views:
    719
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/915120

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice