ScriptBasic

Support => General Discussions => Topic started by: Script_test on October 14, 2016, 04:06:39 AM

Title: module NT
Post by: Script_test on October 14, 2016, 04:06:39 AM
Hi
How to obtain the user name in Windows 10 that is currently active?

Code: [Select]
Import "nt.bas"
print nt::RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI\\SessionData\\1\\LoggedOnUser")

->undef<-

I need to retrieve this registry key ["LoggedOnUser"]

thanks for your help
Title: Re: module NT
Post by: Support on October 14, 2016, 10:08:39 AM
I don't have Windows 10 to test this. Are you sure the registry key you are after is is really there? Can you access any other registry keys?
Title: Re: module NT
Post by: Script_test on November 15, 2016, 01:47:28 AM
Hi
How to obtain the user name in Windows 10 that is currently active?

Code: [Select]
Import "nt.bas"
print nt::RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI\\SessionData\\1\\LoggedOnUser")

->undef<-




I need to retrieve this registry key ["LoggedOnUser"]

thanks for your help



Under ...
windows 7 x32 work fine
windows 7 x64 ->undef
Windows 10- >undef
Title: Re: module NT
Post by: Support on November 15, 2016, 09:24:52 PM
I'm curious if you ran your test registry script as admin would you get the same results?
Title: Re: module NT
Post by: Script_test on November 16, 2016, 03:16:34 AM
I'm curious if you ran your test registry script as admin would you get the same results?

Yup. The same result, i checked again.
Title: Re: module NT
Post by: Support on November 25, 2016, 10:42:25 AM
Script_test,

The registry support functionality is provided by the NT (Windows only) extension module. Windows isn't my main focus extending Script BASIC in the future. If you have the skills to take ownership in resolving the NT issues, the project and I would greatly appreciate it. I hope to have Windows 10 installed in a VM soon for testing.
Title: Re: module NT
Post by: Script_test on December 01, 2016, 01:33:51 AM
Unfortunately I do not have the skills to do this task.
To be realistic, that module is not a priority either.
Thank you very much for your work.
Title: Re: module NT
Post by: Support on December 01, 2016, 02:23:18 PM
I think your problem is that you didn't use the right key name. (LoggedOnUsername)
It works fine for me on Win7 32 bit version in a VirtualBox.

Quote from: john
I don't have Windows 10 to test this. Are you sure the registry key you are after is is really there? Can you access any other registry keys?

Code: Script BASIC
  1. Import nt.bas
  2.  
  3. print nt::RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI\\SessionData\\1\\LoggedOnUsername"),"\n"
  4.  


C:\sbgcc\examples\test>scriba testreg.sb
.\John

C:\sbgcc\examples\test>


Update - I now have Windows 10 installed and once I get Script BASIC setup on it I will try the NT registry access test but I don't expect any issues at this point.

Code: Script BASIC
  1. Import nt.bas
  2.  
  3. print nt::RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI\\SessionData\\1\\LoggedOnUser"),"\n"
  4.  


Microsoft Windows [Version 10.0.14393]

C:\sbgcc\examples\test>scriba testreg.sb
DESKTOP-FEE3LLO\John

C:\sbgcc\examples\test>



Title: Re: module NT
Post by: Script_test on December 02, 2016, 04:55:59 AM
(O,o) I do not understand anything. I tried it again and it works.!

Sorry for the inconvenience, and thank you very much.
 ;D