Flok3r Posted July 29, 2011 Share Posted July 29, 2011 Hi, This is probably simple: Where are information for makros like @username and @desktopdir, which include the username, grabbed from? I need to do it manually, because my script starts before user logon (as system) and shouldn't be restarted for that purpose. So is there any key in the registry? For Win 7 i found this, but unfortunately it doesn't exist in XP. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser I appreciate any help giving me the currently logged on username, Thanks in advance, Flok3r Link to comment Share on other sites More sharing options...
sleepydvdr Posted July 29, 2011 Share Posted July 29, 2011 HKLM\Software\Microsoft\WindowsNT\CurrentVersion\WinLogon Value: "DefaultUserName" #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Flok3r Posted July 29, 2011 Author Share Posted July 29, 2011 Thanks, i ve already read about it, but somehow didnt find it in win 7. However, i ll simply use this in xp and the other in win 7. Link to comment Share on other sites More sharing options...
sleepydvdr Posted July 29, 2011 Share Posted July 29, 2011 You could you @OSVersion to switch between the different operating systems. That will make it so you don't have to write two different scripts for various systems. If @OSVersion = "WIN_XP" Then RegRead..... Else RegRead..... EndIf #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Flok3r Posted July 29, 2011 Author Share Posted July 29, 2011 Ye, as i thought, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now