WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Windows Logon inside vbs script (Read 2708 times)
nprokop
YaBB Newbies
*
Offline



Posts: 1
Windows Logon inside vbs script
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.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2233
The Netherlands
Re: Windows Logon inside vbs script
Reply #1 - 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?
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Dirk
YaBB Administrator
*****
Offline



Posts: 659
South Germany
Re: Windows Logon inside vbs script
Reply #2 - 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
 

Back to top
 

Viele Grüße / Best regards
Dirk - GdP Software

dirk [at] gdpsoftware [dot] com
http://blog-de.gdpsoftware.com
Webseite: http://www.gdpsoftware.com
WWW WWW  
IP Logged
 
Page Index Toggle Pages: 1