DOS login variable

Discussion in 'Software' started by Bustergut, Oct 22, 2005.

  1. Bustergut

    Bustergut Private E-2

    When a user logs in to a W2K terminal on a W2K network, is the username stored as a dos variable or other system variable? I need to delete the folder where their profile is stored when they logout.
     
  2. djlowe

    djlowe Private First Class

    Here's a way to find out if it's set in the environment as a variable: Login, open a CMD window and type SET.

    That'll list all the environment variables.

    A quick check on my laptop shows two variables that might be of use: USERNAME and USERPROFILEDIR. I'm running XP, but Windows 2000 should have the same variables defined, too.

    Hope this helps!

    Regards,

    dj
     
  3. da chicken

    da chicken MajorGeek

    Open a command prompt and type "set" with no paremeters to see a list of all environment variables.

    However, I highly suspect you will have no success doing this in this manner. Logout scripts happen immediately prior to logout, AFAIK, so there will still be files open such as NTUSER.DAT. Running RMDIR /S /Q "%USERPROFILE%" will likely not completely remove everything.

    Are you using Roaming Profiles? If so, you can enable the Delete cached copies of roaming profiles policy under Computer Configuration\Administrative Templates\System\User Profiles.
     

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