Computing.Net > Forums > Programming > Current connected User - Dos Batch

Current connected User - Dos Batch

Reply to Message Icon

Original Message
Name: jpontes6
Date: May 19, 2008 at 11:46:43 Pacific
Subject: Current connected User - Dos Batch
OS: XP
CPU/Ram: 2GB
Model/Manufacturer: Dell
Comment:

Inside of a Dos batch file, i'd like to get the name of the user who is connected to the windows and save that name in a variable to be used inside of the batch.
Is it possible?

I appreciate any help. Thanks.


Report Offensive Message For Removal


Response Number 1
Name: klint
Date: May 20, 2008 at 02:17:07 Pacific
Reply: (edit)

You don't need to create a variable, it already exists:

echo %USERNAME%


Report Offensive Follow Up For Removal

Response Number 2
Name: jpontes6
Date: May 20, 2008 at 06:07:26 Pacific
Reply: (edit)

Thank you! That was exactly what I needed.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Current connected User - Dos Batch

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge