Results 1 to 6 of 6

Thread: create a windows user account

  1. #1

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    create a windows user account

    hi, i am making an online registration scheme for my website for some webspace. i have got every thing sorted out exsept for one thing. to acces the ftp service and upload files to there user space i need to create a user account on the server for that user. is there a way to create a user account on a windows operating system with php 5 installed.
    thanks, dandono
    If there is only one perfect person in the universe, does that make them imperfect?

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: create a windows user account

    In windows you can create a user account using
    Code:
    NET USER [username] [password] /ADD
    you have to be logged into an account that has the access to create other users first, ie admin, as far as i know.

    just use the exec function to call the function

    http://uk.php.net/manual/en/function.exec.php

  3. #3

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: create a windows user account

    it returned this:
    Warning: exec() [function.exec]: Unable to fork [NET USER [test123] [test123] /ADD] in D:\Inetpub\XPROOT\reg\reg1.php on line 54
    i dont use the NET USER command at all but does it need the [] brackets to contain the user or do i remove them?
    My code is below:
    PHP Code:
    exec ('NET USER ' $uid $pw ' /ADD /fullname:"' $fn '" /DOMAIN'); 
    Last edited by dandono; May 1st, 2005 at 04:22 PM.
    If there is only one perfect person in the universe, does that make them imperfect?

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: create a windows user account

    no brackets required. you could try it out from a command prompt to get it working, then to delete it, you could use
    VB Code:
    1. NET USER username /DELETE

  5. #5

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: create a windows user account

    ok i changed my code to this:
    PHP Code:
    exec 'NET USER ' $uid $pw ' /ADD /fullname:"' $fn '" /DOMAIN'
    and it returns:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\Inetpub\XPROOT\reg\reg1.php on line 62
    If there is only one perfect person in the universe, does that make them imperfect?

  6. #6

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: create a windows user account

    can somebody please write me a peice of code because i realy do not get what is wrong with my code but it still returns an error.
    thanks, dandono
    If there is only one perfect person in the universe, does that make them imperfect?

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