Jump to content

This topic is 8224 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

In windows, when starting an FMP application, is there a way to get FMP to read the Window's registered user name as stored in the registry, or the computer's network name?

Thank you.

Posted

The user name is stored in FMP's Application Preferences. I go around and set the names (manually) for all users.

  • 2 months later...
Posted

On a Windows 9x platform, I have a situation where I wanted to grab the user's network login name and use it for my Filemaker solution. I accomplished this by performing the following vbscript after system login and before launching the Filemaker solution:

' setusername.vbs

'-------------------------------------------------

' Read the current network username and store it

' where Filemaker 5.5 and 6.0 store the username

' in the registry.

'

'-------------------------------------------------

Function Key_Exists (key)

Dim keydata

On Error Resume Next

keydata = WSHShell.RegRead (key)

If err <> 0 Then

Key_Exists = False

Else

Key_Exists = True

End if

End Function

'-------------------------------------------------

On Error Resume Next

Dim strUserName, Key55, Key60

' This is where FileMaker keeps the User Name info for 5.5 and 6.0

Key55 = "HKEY_CURRENT_USERSoftwareFileMakerFileMaker Pro5.5PreferencesUser Name"

Key60 = "HKEY_CURRENT_USERSoftwareFileMakerFileMaker Pro6.0PreferencesUser Name"

Set WSHNetwork = CreateObject("WScript.Network")

While strUserName = ""

strUserName = WSHNetwork.UserName

WEnd

On Error GoTo 0

Set WshShell = WScript.CreateObject("WScript.Shell")

if Key_Exists(Key55) then

WshShell.RegWrite Key55,StrUserName,"REG_SZ"

end if

if Key_Exists(Key60) then

WshShell.RegWrite Key60,StrUserName,"REG_SZ"

end if

'-------------------------------------------------------------------

I don't know if it works with profiles and other scenarios, but I'm comfortable poking things into the registry and certainly works for me <grin>. BTW... you may have to let your antivirus know that this script isn't malicious in order for it to be allowed to run.

regards... Bob Minteer

This topic is 8224 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.