4 Replies - 1155 Views - Last Post: 20 November 2013 - 09:26 PM Rate Topic: -----

#1 nikhilgup   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-November 13

wrong user name from windows using environ function in vb6

Posted 20 November 2013 - 11:58 AM

Hi,

I am using windows server 2008 and having issues while picking the username and domain from windows.
I have used following code to retrieve user name and domain
UserName=environ("USERNAME")

UserDomain=environ("USERDOMAIN")


but domain is being picked blank and user name as "SYSTEM"

Note that the code was working ok till last night but something has changed and now it is picking wrong values.

Any Ideas?

Thanks,

Is This A Good Question/Topic? 0
  • +

Replies To: wrong user name from windows using environ function in vb6

#2 andrewsw   User is offline

  • blow up my boots
  • member icon

Reputation: 6551
  • View blog
  • Posts: 26,559
  • Joined: 12-December 12

Re: wrong user name from windows using environ function in vb6

Posted 20 November 2013 - 12:38 PM

You sent me a PM about this but it is not really my area. I would guess that the server went down at some point and it, and/or the terminal, needs to re-initiated/re-started.

I assume a server can be re-booted like a normal computer? I wouldn't know ;)
Was This Post Helpful? 0
  • +
  • -

#3 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2540
  • View blog
  • Posts: 10,177
  • Joined: 03-December 12

Re: wrong user name from windows using environ function in vb6

Posted 20 November 2013 - 01:28 PM

Is this running on the server?
Was This Post Helpful? 0
  • +
  • -

#4 nikhilgup   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-November 13

Re: wrong user name from windows using environ function in vb6

Posted 20 November 2013 - 09:06 PM

Hi,

Yes it is windows server 2008, Actually I have a Virtual Machine with Windows Server 2008 and I am building my code there. I just added that VM to domain and some updates took place after which this started to happen.

Thanks,
Regards,
Nikhil Gupta

View Postastonecipher, on 20 November 2013 - 01:28 PM, said:

Is this running on the server?

Was This Post Helpful? 0
  • +
  • -

#5 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2540
  • View blog
  • Posts: 10,177
  • Joined: 03-December 12

Re: wrong user name from windows using environ function in vb6

Posted 20 November 2013 - 09:26 PM

I may be wrong. But I have had it were the user in who is running the program on the server and normally that is the server itself, system.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1