Hi. How to define path to My Document (users have diferent)
randrews
Member Posts: 135
For example:
One User1 have
C:\Documents and Settings\User1\My Documents\
Another User2:
C:\Documents and Settings\User2\My Documents\
How to know real path on client machine who run report?
Thanks
One User1 have
C:\Documents and Settings\User1\My Documents\
Another User2:
C:\Documents and Settings\User2\My Documents\
How to know real path on client machine who run report?
Thanks
0
Comments
-
Hi,
Look at the
http://www.mibuso.com/forum/viewtopic.p ... light=path
that goes thru the environemt parameters, but you must set the my documents parameter to the system first.
or you could look at the:
http://www.mibuso.com/forum/viewtopic.p ... light=path
to use with registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
in the personal value that keeps the location of my documents.0 -
Info about reading register helps me
Thank you0 -
The simplest way would be:
MyDocPath := ENVIRON('USERPROFILE') + '\My Documents';since USERPROFILE returns: C:\Documents and Settings\user
Beware that OS langauge may affect 'My Documents' is also translated. You can define multilanguage TextConstant.
The most accurate would be to read registry.®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
Lots of options here... Here's another one:
PROCEDURE GetSpecialFolder(FolderName : Text[20]) : Text[250]; VAR wshShell : Automation 'Windows Scripting Host.wshShell'; vntFolderName : Variant; vntFolderPath : Variant; BEGIN CREATE(wshShell); vntFolderName := FolderName; vntFolderPath := wshShell.SpecialFolders.Item(vntFolderName); CLEAR(wshShell); IF vntFolderPath.ISTEXT THEN EXIT(FORMAT(vntFolderPath)); END;Call this with 'MyDocuments', or one of the other special folder names in this list:
http://msdn.microsoft.com/library/defau ... olders.asp0 -
to RobertMo
Unfortanitly, in our company OS Windows English and Windows Russian. 'My Documents' in two languages (on diferent system). So write directly 'My Documents' isn't work in russian versions.
I did it with Automation 'Windows Scripting Host.wshShell'
Thanks to all0
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
- 322 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
