Batch Files. If statement :confused:

Discussion in 'Software' started by jdisney, Apr 6, 2005.

  1. jdisney

    jdisney Private E-2

    HI,
    I have 4 batch files; one for sales, administration, accounting and general users. I’m trying to combine them into one big batch file. Within this new batch file is there a way I can put a “IF user is a group member of Sales” map these drives, and the same for the other 3 type of groups. If so, what is the syntax for it? Can someone write an example for me?

    For example, I have tried (which was the only thing I was able to find on the internet) but it doesn’t work. I get a:
    “Bad command or file name
    Syntax error”.

    echo. Mapping Your Home Drive
    net use h: /home
    echo. Mapping Network Drive
    net use k: \\server\network


    IF INGROUP(“Domain Users”)
    echo. FOR THE GENERAL USERS
    echo. Attaching General Drives
    echo. Mapping Software
    net use s: \\king\software
    echo.
    ENDIF

    IF INGROUP(“G-Sales”)
    echo. FOR THE SALES USERS
    echo. Attaching Sales Drives
    echo. Mapping Sales Software
    net use x: \\software\software
    echo.
    ENDIF

    Any help would be greatly appreciated!!!
    Jess
    jdisney@telco1.com
     
  2. Kodo

    Kodo SNATCHSQUATCH


MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds