Jump to content

Get login name


Recommended Posts

My customer wants to include the Windows login name of the current user in the report file for a unit under test. While talking with NI tech support we found

http://sine.ni.com/apps/we/niepd_web_displ...source=External

which works fine running under the development system, but won't as an executable. I put the required file in the same folder as the executable as instructed, but apparently it will not work without the LabWindows CVI runtime engine. The NI technician was able to get it to work in an executable, but admitted that she had CVI installed on her machine.

Upon attempting to launch I get the following messages:

"The application has failed to start because cvirt.dll was not found..."

"LabVIEW: Resource file not found. The file 'sdk_project.dll' is not a valid LabVIEW file."

"LabVIEW: Resource not found. An error occurred loading VI 'User Name (SDK call).vi'. LabVIEW load error code 3: Could not load front panel."

"Missing subvi in User Name (SDK call).vi in ..."

I am using LabVIEW 8.01FD under WinXP Pro, SP2.

Any assistance GREATLY appreciated.

Roy

Link to comment
My customer wants to include the Windows login name of the current user in the report file for a unit under test.

I am using LabVIEW 8.01FD under WinXP Pro, SP2.

Any assistance GREATLY appreciated.

Roy

Roy,

The most reliable method I know (using the Windows API) is attached, it uses two CLNs and returns the login name and the NetBIOS computer name. I've used this since LV5. The attached VI is saved back to 7.1 format for the widest audience. Probably Dirk J.'s VI does the same thing, but his is in 8.2 format and I noticed that you're using LV8.

The VI Server property that Yen mentioned may work, but it doesn't always give you the Windows logon name - LV options (tools->options->revision history) may cause it to retrieve the LV registration name, or a 'prompt at startup' name. And I'm not at all sure that it works in built applications.

Hope this helps.

Dave

Download File:post-195-1162995389.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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