Subscribe Bookmark RSS Feed

tracking script usage

I'm trying to get user information into jmp 7.0 I have scripts that are being used by others in the company and I'd like to know who specifically for tracking purposes. in windows i can use %username% to get the logged in user now is there a way to get that information into JMP?
1 REPLY
mattf

Community Trekker

Joined:

Jun 23, 2011

Hi Justin:

JMP 9 makes it nice and easy to bring in a single envirionmental variable on Windows e.g.

user = Get Environment Variable("USERNAME"); show(user);

If prior to v9, one way ...

<-
// write the values to a ASCII file
SaveTextFile( "C:\temp\deleteme.bat",
"set > C:\temp\x.txt"
);
Open( "C:\temp\deleteme.bat" );

// bring 'em all in a data table
dt = Open( "C:\temp\x.txt", End Of Field (Other), EOFOther ("="), labels(0),
Columns(Name=character(20), Value=character(200)) );

// display desired name/value pair
For Each Row( if(:Name=="USERNAME", show(Name, Value)) );
-->

For a "bit more involved example" to go out and grab 'em all and stuff 'em in an array see:

Accessing the power & functionality of the MS Windows API via the JMP LoadDll function @ NESUG, 2010

http://www.nesug.org
http://www.nesug.org/Proceedings/nesug10/ad/ad04.pdf

Best Regards,
-Matt