Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Limit access to records by user

Featured Replies

I need to limit access to records by user by their Windows Logon Name. Essentially I want to copy their username out of the registry and paste it into a field in Filemaker. I know this can be done using a very simple VBScript, but I haven't been able to make it work. I would appreciate any help from a more talented scripter.

  • Author

I figured this one out. If anybody else would like to use it, this script pulls the username from the registry and creates a tab separated data file in the C drive that you can import data from - thereby logging who accessed your database.

Set wshell = WScript.CreateObject("Wscript.Shell")

Name2_CopyFromKey = "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"

Name2_CopyFromValue = "DefaultUserName"

Name3_Key = "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"

Name3_Value = "AltDefaultUserName"

Machine_Key = "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlComputerNameActiveComputerName"

Machine_Value = "ComputerName"

MachineName = wshell.RegRead (Machine_Key + Machine_Value)

UserName2Value = wshell.RegRead (Name2_CopyFromKey + Name2_CopyFromValue)

UserName3Value = wshell.RegRead (Name3_Key + Name3_Value)

'deletes user's temporary login file.

On Error Resume Next

Set fs = CreateObject("Scripting.FileSystemObject")

fs.DeleteFile("C:un.duf")

Dim FSO, AFile, AFileStream

Dim strSrcDir

' Set variables

strSrcDir = "c:"

' Set Objects

Set FSO = CreateObject("Scripting.FileSystemObject")

on error resume next

Set oFile=fso.GetFile("C:un.duf")

'Removes all file attributes, expecially read-only

oFile.Attributes = oFile.Attributes AND 0

If Err.Number = 0 Then

Set AFileStream = FSO.OpenTextFile(strSrcDir + "un.duf",2)

else

Set AFileStream = FSO.CreateTextFile(strSrcDir + "un.duf",2)

end if

' to enter quotes, either use double quotes, or the chr(34) character while chr(09) is tab.

AFileStream.WriteLine MachineName + chr(09) + UserName2Value + chr(09) + UserName3Value

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.