Search code examples
foxpro

Visual foxpro Replace commands / CMD


I want to make a program in foxpro where you can type a name in a textbox and it will automatic add a user in command prompt. So netuser ( name ) and a button (add user ) Regards

Chris


Solution

  • * Does the initial setting for foxpro
    *
    set echo off
    set talk off
    set step off
    set date british
    set century on
    set intensity off
    set delimiter on
    set delimiter to '[]'
    set scoreboard off
    set menu off
    set safety off
    set deleted on
    set escape on
    set device to screen
    set color to
    set exclusive on
    set status on
    set bell off
    clear all
    clear program
    clear
    *
    ** define a variable to store user name to be created
    
    muser_name = space(20) 
    @ 12, 22 say 'Enter User Name ' get muser_name
    read
    if !empty(muser_name)
       * this command adds a new user to the computer
       run net user &muser_name /add
    endif
    wait
    clear
    clear program
    return
    **
    * end of program
    

    This will create a new user to your computer without any password.