Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts

    batch: variables

    i am trying to copy the contents of a 3½ into a directory on c:\

    is there any way to set the destination path into a variable so the whole batch file defaintately uses the same directory and i only have to use it once etc.. plz dont tell me i dont need it, i just want to konw how its done please

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The "set" command is used to create and update environment variables which can then be used in batch files.

    Code:
    set myPath = "c:\"
    dir %myPath%
    pause
    Run that as a BAT file and you can see how it works.
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •