Operation System functions issues

Pit
Member Posts: 3
Hello everyone!
It is not a secret that some operation system functions are not supported in RTC.
Does anybody have an idea how can I get values of SYSTEMDRIVE, COMPUTERNAME, TEMP,TMP ... and/or other system variables?
In the classic client I can use the ENVIRON function, but this function is not supported in the RoleTailored client.
For example:
In the Classic client ENVIRON('TEMP') will return me the path to the temporary system folder.
In th RTC the similar path will be after using CREATETMPFILE func and getting the path of a created file.
Or If the temporary place is not critical for solution – the TEMPORARYPATH function can be used.
But it is only one alternative.
What about analogs to
ENVIRON('SYSTEMDRIVE')
ENVIRON('COMPUTERNAME')
ENVIRON('SYSTEMROOT')
ENVIRON('WINDIR')
...
?
Thx a lot in advance.
P.S. Windows Vista Business.
It is not a secret that some operation system functions are not supported in RTC.
Does anybody have an idea how can I get values of SYSTEMDRIVE, COMPUTERNAME, TEMP,TMP ... and/or other system variables?
In the classic client I can use the ENVIRON function, but this function is not supported in the RoleTailored client.
For example:
In the Classic client ENVIRON('TEMP') will return me the path to the temporary system folder.
In th RTC the similar path will be after using CREATETMPFILE func and getting the path of a created file.
Or If the temporary place is not critical for solution – the TEMPORARYPATH function can be used.
But it is only one alternative.
What about analogs to
ENVIRON('SYSTEMDRIVE')
ENVIRON('COMPUTERNAME')
ENVIRON('SYSTEMROOT')
ENVIRON('WINDIR')
...
?
Thx a lot in advance.
P.S. Windows Vista Business.
Petro Bufan
Software Development Engineer
MS Dynamics NAV for MCPs
Software Development Engineer
MS Dynamics NAV for MCPs
0
Comments
-
If you can rely on Windows Scripting Host being available, the following works:
Declare an automation variable called WSH of type Windows Script Host Object Model.WshShell:WSH Automation 'Windows Script Host Object Model'.WshShell
and thenIF ISSERVICETIER THEN CREATE(WSH, TRUE, TRUE) ELSE CREATE(WSH, TRUE); MESSAGE(FORMAT(WSH.ExpandEnvironmentStrings('%TEMP%')));
This prints the value of the environment variable %TEMP% of the session the RTC is running in. If you need it on the server side, just make the third parameter to CREATE a "false".
There are probably better ways, but this works for me.0 -
Thx. It really works as I need.Petro Bufan
Software Development Engineer
MS Dynamics NAV for MCPs0 -
You can use ISSERVICETIER directly in CREATE function to avoid that IF...THEN statement:
CREATE(WSH,FALSE,ISSERVICETIER);
0 -
Hi All,
With reference to above I have another query i.e.
As we know that ENVIRON function is not supported in RTC hence how to get the value for windows user name in RTC. Earlier we use to get it by :
ENVIRON('USERNAME')
Thanks in Advance!
Regards,
Abhishek Pareek0 -
Can't you just use USERID ?0
-
Hey it is resolved. Actually I have to fetch the windows login instead of navision login.
I used this command:
WSH.ExpandEnvironmentStrings('%USERNAME%');
Thanks,
Abhishek0
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