Author Topic: module NT  (Read 11858 times)

Script_test

  • Newbie
  • *
  • Posts: 37
module NT
« 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

support

  • Administrator
  • *****
  • Posts: 859
    • Script BASIC Open Source Project
Re: module NT
« Reply #1 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?
Script BASIC Project Manager

Script_test

  • Newbie
  • *
  • Posts: 37
Re: module NT
« Reply #2 on: November 15, 2016, 02: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

support

  • Administrator
  • *****
  • Posts: 859
    • Script BASIC Open Source Project
Re: module NT
« Reply #3 on: November 15, 2016, 10:24:52 PM »
I'm curious if you ran your test registry script as admin would you get the same results?
Script BASIC Project Manager

Script_test

  • Newbie
  • *
  • Posts: 37
Re: module NT
« Reply #4 on: November 16, 2016, 04: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.

support

  • Administrator
  • *****
  • Posts: 859
    • Script BASIC Open Source Project
Re: module NT
« Reply #5 on: November 25, 2016, 11: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.
Script BASIC Project Manager

Script_test

  • Newbie
  • *
  • Posts: 37
Re: module NT
« Reply #6 on: December 01, 2016, 02: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.

support

  • Administrator
  • *****
  • Posts: 859
    • Script BASIC Open Source Project
Re: module NT
« Reply #7 on: December 01, 2016, 03: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>



« Last Edit: December 02, 2016, 12:23:52 AM by support »
Script BASIC Project Manager

Script_test

  • Newbie
  • *
  • Posts: 37
Re: module NT
« Reply #8 on: December 02, 2016, 05: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