+ Post New Thread
Results 1 to 8 of 8
Scripts Thread, whats wrong with this script :( in Coding and Web Development; Im trying to create load of folders and name them from a txt file but it instantly errors. Code: @Echo ...
  1. #1
    PEO
    PEO is offline
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,096
    Thank Post
    457
    Thanked 152 Times in 96 Posts
    Rep Power
    72

    whats wrong with this script :(

    Im trying to create load of folders and name them from a txt file but it instantly errors.

    Code:
    @Echo off
    set basedir=d:\users
    for /f "tokens=*" %%a in (values.txt) do mkdir %basedir%\%%a
    any ideas what is wrong with it ?

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    works fine here; what error do you get? What have you got in the file values.txt? is that file in the same location as your batch file?

  3. Thanks to srochford from:

    PEO (16th June 2009)

  4. #3
    jmcdermott's Avatar
    Join Date
    Feb 2008
    Location
    Cornwall
    Posts
    177
    Thank Post
    17
    Thanked 44 Times in 36 Posts
    Rep Power
    21
    try set basedir="d:\users"
    instead of
    set basedir=d:\users

  5. Thanks to jmcdermott from:

    PEO (16th June 2009)

  6. #4
    PEO
    PEO is offline
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,096
    Thank Post
    457
    Thanked 152 Times in 96 Posts
    Rep Power
    72
    attached screen shot

    tryed that and it didnt work

    named the file as a .vbs

    the txt file has a list of names e.g

    Joe loves
    Joe bloggs
    etc
    etc
    Attached Images Attached Images

  7. #5
    Newton's Avatar
    Join Date
    Oct 2007
    Posts
    179
    Thank Post
    59
    Thanked 5 Times in 5 Posts
    Rep Power
    15
    shouldnt it be named .bat

  8. Thanks to Newton from:

    PEO (16th June 2009)

  9. #6
    PEO
    PEO is offline
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,096
    Thank Post
    457
    Thanked 152 Times in 96 Posts
    Rep Power
    72
    lmfao!!!! what a dimwitt!!

    Im cracking up

  10. #7
    PEO
    PEO is offline
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,096
    Thank Post
    457
    Thanked 152 Times in 96 Posts
    Rep Power
    72
    Hi, script worked fine after I changed the file extension to a .bat. Just created over 350 individual folder for each student between year 7 and 9.

    I wonder If I could have used a dsquerry rather than 1st extracting names to a txt file.

  11. #8
    PEO
    PEO is offline
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,096
    Thank Post
    457
    Thanked 152 Times in 96 Posts
    Rep Power
    72
    I can now use the same script to copy a file of files in to each user folder.

SHARE:
+ Post New Thread

Similar Threads

  1. Whats ya.........
    By IanT in forum General Chat
    Replies: 33
    Last Post: 15th September 2009, 01:26 PM
  2. Whats This
    By teejay in forum General Chat
    Replies: 28
    Last Post: 15th April 2009, 01:10 PM
  3. My school infrastucture - whats wrong with this picture?
    By gman in forum Windows Server 2000/2003
    Replies: 16
    Last Post: 10th February 2009, 09:33 AM
  4. script to log dns cos some are wrong
    By browolf in forum Coding
    Replies: 0
    Last Post: 13th November 2008, 03:07 PM
  5. [News] Whats in a name...
    By Gatt in forum Jokes/Interweb Things
    Replies: 5
    Last Post: 27th July 2008, 01:31 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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