WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> Windows Logon inside vbs script
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1329943476

Message started by nprokop on Feb 22nd, 2012 at 9:44pm

Title: Windows Logon inside vbs script
Post by nprokop on Feb 22nd, 2012 at 9:44pm
Is there an environment variable for Windows Logon (person who put file there)

I can see %WD_FILE_OWNER% ....

It seems to return FirstName or something ...

Need inside a vbs script

Thanks.

Title: Re: Windows Logon inside vbs script
Post by Gert on Feb 23rd, 2012 at 9:18am
Sorry, I have no idea how to get that kind of info. Perhaps you need to access active directory for that?

Title: Re: Windows Logon inside vbs script
Post by Dirk on Feb 23rd, 2012 at 9:28am
nprokop,

I am not sure what you want to have.
You can see the actual logged on user by reading the environment variable %username% in a dos box , but the user can be different from the user who changed/wrote/deleted a file and can be different from the user who is the owner of a file.

This VBS code gives you back the name of the logged in user:
[code]
Set objNetwork = wscript.CreateObject("wscript.network")
MsgBox objNetwork.Username
[/code]

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.