computer name with environmental variable

jam176
Member Posts: 27
hello!
i'm looking for an easy way to find out the current computername. searching the forum i found a topic where the environmental variable %COMPUTERNAME% was mentioned.
well, but how can i read this variable? i tried out
environment: windows 2000, navision 3.60
can anyone give an advice?
thx
jam176
i'm looking for an easy way to find out the current computername. searching the forum i found a topic where the environmental variable %COMPUTERNAME% was mentioned.
well, but how can i read this variable? i tried out
sCN:= ENVIRON(Computername);but the result is nonsens.
environment: windows 2000, navision 3.60
can anyone give an advice?
thx
jam176
thx
jam176
jam176
0
Comments
-
Open a command prompt on your Win2K machine and type SET | MORE. Do you see a variable called COMPUTERNAME?Kind regards,
Jan Hoek
Product Developer
Mprise Products B.V.0 -
yes, i do!thx
jam1760 -
Perhaps the variable names are case sensitive?! Could you call the ENVIRON function and pass the variable name, using the exact same character case as you saw in your Command Prompt window?Kind regards,
Jan Hoek
Product Developer
Mprise Products B.V.0 -
You have to put COMPUTERNAME between ' .
Try :
MESSAGE('%1',ENVIRON('COMPUTERNAME'));
It works ...0 -
that's it! boah! thanks a lot. quite simple, isn't it. shame on me.
thanx again jhoek!thx
jam1760 -
I don't think your code would compile if you forget the quotes?! Or... do you perhaps have a variable named ComputerName in the same object/scope?Kind regards,
Jan Hoek
Product Developer
Mprise Products B.V.0 -
ineet i've made a big mistake:
the environ() call is inside a table, where computername is a tablefield! when i called computername without the qoutes i got the fielddata instead of the environmental varible.
thank you all!thx
jam1760 -
At the risk of sounding like a standards zealot...
Field names should be in English, and in that language, I believe ["computername"] would be written as "computer name" (with a space). In this particular case, spelling the field name like that would have prevented some rather time-consuming troubleshooting...
And yes, I know, I should mind my own business...Kind regards,
Jan Hoek
Product Developer
Mprise Products B.V.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions