Re: username
- From: "Rod Harrison" <rharrison@xxxxxxxxx>
- Date: Thu, 22 Sep 2005 15:29:19 -0400
This is a batch script that will calculate the first and last name and place
them into variables that you can then use.
See my example below.
********************************************
@echo off
for /f "Tokens=1-4" %%a in ('net user "%username%" /domain') do if /i
"%%a"=="Full" if /i "%%b"=="Name" set fnme=%%c
for /f "Tokens=1-4" %%a in ('net user "%username%" /domain') do if /i
"%%a"=="Full" if /i "%%b"=="Name" if /i "%%c"=="%fnme%" set lnme=%%d
echo %fnme% %lnme%
********************************************
I basically figure out the first name and last name from AD and place those
results into variables %fnme% and %lnme%
You could use these variables to do what you are requesting.
"Juan" <juanb@xxxxxxxxxxx> wrote in message
news:DB1BC30E-D0AF-42CE-A13D-3D3615428B71@xxxxxxxxxxxxxxxx
> Hi can some one please help
>
> I am using a xcopy command as follow
>
> xcopy c:\admin z:\%username% /y
>
> this is not the probleme but i have a user that is juanb but then it saves
> his stuff under his username juanb but the probleme is i have his name
> under
> the z: as Juan Bredenkamp now is there a way i can do this by entering
> maby
> %firstename% & %lastname% or %fullusername% maybe
>
> there is to many users that i have to change on our z:\ if i whant to use
> there usernames as the directory
>
> i would rather use there full names that the "AD" has it is just a matter
> of
> reading it out
>
> example xcopy c:\admin z:\%fullname% /y
>
> please help
> --
> Juan Bredenkamp
.
- Follow-Ups:
- Re: username
- From: Rod Harrison
- Re: username
- Prev by Date: Re: Invoking a file's property dialog
- Next by Date: Re: username
- Previous by thread: Only showing three letter extensions with dir
- Next by thread: Re: username
- Index(es):