My VB.net written application is being executed by an MSI file, and I need to get the currently logged on user (who is running the MSI). This is because I am importing xml files into the task scheduler and without the correct usersname, there is a mapping error. Currently, because the application is being run through the MSI or windows installer the System user is being used. This is causing a mapping error so I was wondering if there is any other way to find the logged on user.
MsgBox(Environment.UserName)
Dim WSHNetwork = CreateObject("WScript.Network")
MsgBox(WSHNetwork.Username)
Both message boxes return "SYSTEM", whereas I need it to return the actual logged on user.