Re: username

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Rod Harrison" <rharrison@xxxxxxxxx> wrote in message
news:%23WiGRy6vFHA.3556@xxxxxxxxxxxxxxxxxxxxxxx
> Be careful, my previous post word wrapped. I am resending this to notate
> where each line starts
>
> ********************************************
> Line 1- @echo off
> Line 2- for /f "Tokens=1-4" %%a in ('net user "%username%" /domain') do if
> /i "%%a"=="Full" if /i "%%b"=="Name" set fnme=%%c
> Line 3- 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
> Line 4- echo %fnme% %lnme%
> ********************************************

Another common (and simpler) way to annotate linewrap is to prefix each line
with whitespace, i.e.:

********************************************
@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%
********************************************

/Al


> 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.
>
>
>


.



Relevant Pages

  • Re: problem with include.
    ... function inside the IF block that was icluded in common. ... posts automatically by running PHP script. ... echo "Updating existing topic...\n"; ...
    (comp.lang.php)
  • Re: problem with include.
    ... function inside the IF block that was icluded in common. ... posts automatically by running PHP script. ... echo "Updating existing topic...\n"; ...
    (comp.lang.php)
  • Re: Possible to search ALL except filetype?
    ... Or I can narrow it down alittle bit or just put in the common .exts. ... I dump alot of images onto DVDs. ... that aren't the common picture types. ... Remove the word "echo" in the last line to activate the batch file. ...
    (microsoft.public.windowsxp.general)
  • Re: If() action within print()..?
    ... >> Don't assume I didn't look for the asnwer before I posted. ... > echo 'class2'; ... >> well, gimme a break. ... common sense isn't all that common. ...
    (comp.lang.php)
  • Re: How to return user name in a script even if run by SUDO?
    ... common@common-laptop:~$ sudo echo $ ... Kapil Singh Kushwah ... _BEFORE_ executing sudo. ...
    (Ubuntu)