Results 1 to 3 of 3

Thread: parsing a text file for input into applicaation

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    1
    I have over 1500 NT Domain users that I have to change the password for every 90 days. (Actually someone else does and they always manage to fat-finger it so I get 100 calls a day to re-enter the passwords) I had the brilliant idea of using NET USER in a batch file to do this only I couldn't figure out how to get the batch file to parse a text file containing the username, domain, and password. So then I got the wonderful idea of doing it with VB. The application itself works fine, can change passwords in any of my trusted domains, case sensitive, etc etc...now I'd like to automate the process so I don't have to enter each and every user name, domain and password in the text boxes. I have a text file that contains username in one column, domain in the next column, and the new password in a third column, all seperated by comma's. I added a button that will open the text file and now what I need to be able to do is parse said file, filling in the blanks, and either manually click OK so the password change takes effect or better yet, be able to fully automate it so I don't have to watch it. I can't seemd to apply what I know so that this happens. I'd be glad to post or email the code I have (which I'll do at some point anyway cuz I'm not the only one who changes mass numbers of passwords I'm sure) for a little help. The application only runs on NT of course and I DON'T have any checks to see if the user running the app has admin priviledges...(yet another hole in NT >8^)

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Talking this works great...

    Check this article out here

    http://www.vb-world.net/tips/tip87.html

    The code works great for parsing strings, so just add it into a loop, read each line from your text file, and happy string parsing.

    Cheers

    Andrew

  3. #3
    Guest
    Use the Split function.

    Code:
    Retval = Split(Text1, ",")
    
    For I = 0 To UBound(Retval)
        Print Retval(I)
    Next I

Posting Permissions

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



Click Here to Expand Forum to Full Width