Showing posts with label Dos. Show all posts
Showing posts with label Dos. Show all posts

2009/05/27

Get windows login name?

To get windows login name, you can type this in dos prompt:
echo %username%

To get windows login name in sql, you can type this:
exec master..xp_cmdshell 'echo %USERNAME%'