And I second Thom's thanx!!! Worked like a charm.
Sherry 816/823-0406 ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, August 04, 2008 14:04 To: [email protected] Subject: RE: [Talk] Computer Name Greetings, Thanks Troy! Learn something new every day - I guess that is a good thing... Regards, Thom Thom C. Blackwell Product Manager Boston Software Systems (866) 653-5105 ex 807 www.bossoft.com <http://www.bossoft.com/> Sign up for my weekly webinar! <http://www.bostonworkstation.com/customer_center/special_events.aspx> LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately, then delete this message and empty from your trash. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brumley, Troy Sent: Monday, August 04, 2008 2:53 PM To: [email protected] Subject: RE: [Talk] Computer Name Since VBA can access system environment variables, %COMPUTERNAME% would do the trick without having to call out to an external API. I found this link with a VBA example to list all environment variables: http://www.tek-tips.com/faqs.cfm?fid=4296 I tried the following in the latest version of BWS and got the answer I expected: Dim s As String s = Environ("COMPUTERNAME") To see all your environment variables you could use the sample or just open up a DOS prompt and type in "SET" and check the output. There's a lot of useful information there. Hope this helps, Troy Brumley Cincom Systems Lead Software Engineer, Cincom intelligent Business Applications Telephone: Office (+1) 513 612 2686 Fax (+1) 513 612 2000 Cellular (+1) 513 604 3569 Blog: http://www.cincomsmalltalk.com/userblogs/troy/blogView www.cincom.com This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient or the person responsible for delivering to the intended recipient, please be advised that it has been sent in error and therefore any use is strictly prohibited. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, August 04, 2008 2:39 PM To: [email protected] Subject: RE: [Talk] Computer Name Greetings, Out of curiosity, what is the use case here? We don't have a command for that - but if there is a compelling reason for same - I'm happy to lobby for its inclusion! Below is a function that will do this. Only credit I can take for this is adding the helpful comments and putting the code into a copy / paste friendly form. I got it from here... http://www.codeproject.com/KB/vbscript/SystemUtility.aspx Paste in the below into your Project 'This goes at the very tippy top of the module Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long 'This can go anywhere Public Function GetTheComputerName() As String Dim strComputerName As String ' Variable to return the path of computer name strComputerName = Space(250) ' Initilize the buffer to receive the string GetComputerName strComputerName, Len(strComputerName) strComputerName = Mid(Trim$(strComputerName), 1, Len(Trim$(strComputerName)) - 1) GetTheComputerName = strComputerName End Function Thom C. Blackwell Product Manager Boston Software Systems (866) 653-5105 ex 807 www.bossoft.com <http://www.bossoft.com/> Sign up for my weekly webinar! <http://www.bostonworkstation.com/customer_center/special_events.aspx> LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately, then delete this message and empty from your trash. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mitchell Sherry - Mid West Div. Sent: Monday, August 04, 2008 2:29 PM To: [email protected] Subject: [Talk] Computer Name Is there a command to capture the name of the computer running the script? thanx, Sherry HCA Midwest Health Systems IT&S Programmer/Analyst II 816/823-0406 "Some of us are more capable than others of us...but none of us is more capable than all of us" Tom Wilson/Ziggy
