1 Reply Latest reply on Feb 20, 2015 3:55 PM by philmodjunk

    Capturing PC Computer Name

    antidote

      Title

      Capturing PC Computer Name

      Post

      I worked way to long today to figure out how to capture the computer name that filemaker pro is running on.

      FileMaker only gives us get(HostName) which returns the name of the computer that is hosting the file.
       
      I needed to capture all of the PC names that a Client uses in a large organization. So I decided to use the Command Line after other attempts at using a local FileMaker file.
      The command line:  Echo %computername% 
      is the right call accept how do I get that off the screen?  So I tried to saving it as a txt file:
       
      Echo %computername%2>c:\fmName.txt
       
      This works, but all the PCs are managed so I was afraid for good reason that it would not write to the Root directory.  I could not change the file path to another location, however in hindsight I probably just need to add another command line of cd\ c:\documents and settings\….
       
      But I found a better way anyway. So entering the below into in Send Events
       
      cmd \c
      Echo %computername% | Clip
       
      This copies the Echo to the Clipboard so I can use the next line to paste it into a field in FM.
      Just thought I would share in case you come across a similar issue.
       
      Tim Brown
      Antidote Solutions
      516.873.0030 x100
       
       

        • 1. Re: Capturing PC Computer Name
          philmodjunk

          Definitely a clever Idea. One obvious negative to consider is that if the user has copied data to the clipboard and then your script runs, the user's data is lost and replaced by the name of their computer--not an ideal situation.

          You might consider populating a table in your computer with two fields of data: the computer name and the value returned by Get ( PersistentID ). You can run the script to capture the compture name only once, then create a record in the table with the persistentID and computer name. A script can use the current value of Get ( PersistentID ) to look up the computer name from this table and only use the send event script step to get the computer name when the current persistentID is not present in the table.