Including Kernel32.dll in VBScript to call GETACP()

jordi79
Member Posts: 280
Hi,
I need to call the GETAcp function in Kernel32.dll from NAV to get the ANSI codepage in the local client machine. I am having problems in scripting this script. My script is as follows:
But I am getting compilation errors:
Windows Script Host
Script: C:\temp.vbs
Line: 1
Char: 17
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error
OK
is there something wrong with my code? Is there any alternative to get the local ANSI code page?
many thanks.
I need to call the GETAcp function in Kernel32.dll from NAV to get the ANSI codepage in the local client machine. I am having problems in scripting this script. My script is as follows:
Private Declare Function test123 Lib "Kernel32.dll" () As Long Msgbox test123
But I am getting compilation errors:
Windows Script Host
Script: C:\temp.vbs
Line: 1
Char: 17
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error
OK
is there something wrong with my code? Is there any alternative to get the local ANSI code page?
many thanks.
0
Comments
-
You can use the Windows Language table to read it for specific language. But you need to select correct language...0
-
i assume you are referring to the language table in NAV. This table will only list all the windows language codes. I want to find out what is the language that the local client is using. this can be changed by the users in regional settings. but i want to know what language code is configured, so that I can do some language specific formatting.0
-
Try WMI call in VBScript instead.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Yes. WMI scripts called via VBScript is the solution. it works.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