DISQUS

DISQUS Hello! Tech-Recipes is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Tech-Recipes

Cookbook of Tech Tutorials
Jump to original thread »
Author

XP batch files: Create variable for current user account and find current user | Batch file programming | Tech-Recipes

Started by qdideas · 9 months ago

No excerpt available. Jump to website »

2 comments

  • :lol: I need this file (or one like it) in a BAD way right now.....but this one did NOT work as advertised. I'm sure there's just a teeny adjustment needed in the syntax. Can someone read the syntax and help? Or tell me why it does NOT place a (username).txt file ANYWHERE in the logged-on user's profile?
    THANX!
  • Hi

    I can't see your batch file, but in this example

    @echo off
    Echo Current user: %USERNAME% > "%USERPROFILE%%USERNAME%.txt"

    <Note: the Echo line is supposed to be on 1 line if it does not show on 1 line>

    A text file will be created in the current users profile folder with their username as the file name with the text Current user: <username>

    In XP, this would be in C:Documents and Settings<username>
    In Vista, this would be C:Users<username>

    Hope this is what you were looking for.

    RLJ

Add New Comment

Returning? Login