Domain Builder

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 16 March 2008

Retrieve an environment variable

Posted on 14:59 by Unknown
Retrieve an environment variable
ContextKeyword lcxk_base
string ls_Path
string ls_values[]

this.GetContextService("Keyword", lcxk_base)
lcxk_base.GetContextKeywords("path", ls_values)
IF Upperbound(ls_values) > 0 THEN
ls_Path = ls_values[1]
ELSE
ls_Path = "*UNDEFINED*"
END IF


Common XP environment variables:

ALLUSERSPROFILE location of the All Users Profile.
APPDATA location where applications store data by default.
CD current directory string.
CLIENTNAME client's NETBIOS name when connected to terminal server session.
CMDCMDLINE command line used to start the current cmd.exe.
CMDEXTVERSION version number of the current Command Processor Extensions.
CommonProgramFiles path to the Common Files folder.
COMPUTERNAME name of the computer.
COMSPEC path to the command shell executable.
DATE current date.
ERRORLEVEL error code of the most recently used command.
HOMEDRIVE drive letter is connected to the user's home directory.
HOMEPATH full path of the user's home directory.
HOMESHARE network path to the user's shared home directory.
LOGONSEVER name of the domain controller that validated the current logon session.
NUMBER_OF_PROCESSORS number of processors installed on the computer.
OS name of the operating system.
(Windows XP and Windows 2000 list the operating system as Windows_NT.)
Path search path for executable files.
PATHEXT file extensions that the operating system considers to be executable.
PROCESSOR_ARCHITECTURE processor's chip architecture.
PROCESSOR_IDENTFIER description of the processor.
PROCESSOR_LEVEL model number of the computer's processor.
PROCESSOR_REVISION revision number of the processor.
ProgramFiles path to the Program Files folder.
PROMPT command-prompt settings for the current interpreter.
RANDOM random decimal number between 0 and 32767.
SESSIONNAME connection and session names when connected to terminal server session.
SYSTEMDRIVE drive containing the Windows root directory.
SYSTEMROOT location of the Windows root directory.
TEMP and TMP default temporary directories for applications that are available to
users who are currently logged on.
TIME current time.
USERDOMAIN name of the domain that contains the user's account.
USERNAME name of the user currently logged on.
USERPROFILE location of the profile for the current user.
WINDIR location of the OS directory.
Email ThisBlogThis!Share to XShare to Facebook
Posted in PowerScript | No comments
Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Using Windows Scripting Host
    You can use Windows Scripting Host on PowerBuilder for many purpose. On sample code below, you can use it to get the network domain, user na...
  • List available ODBC datasources
    You can list available ODBC datasources from within PowerBuilder. You need to declare the following external functions : FUNCTION integer SQ...
  • Sorting Datawindow
    Here's a script to sort datawindow rows when the column header is clicked as in windows explorer. Requirements : Column header should be...
  • Faster Exist Checking in Oracle
    When performing checks in business logic to see if a record is used as part of a foreign key in a child table people often opt for the Selec...
  • Return Code on Application Exit
    Sometime when a PowerBuilder application is called by other program or a shell script, programmer want a return code after exiting the Power...
  • Keeping Column into Array
    With this simple tips you can keep all the column name on DataWindow into an array int colNum, numCols string colName[] numCols = Integer(dw...
  • Julian Date
    Here's a function to calculate Julian Day number for the specified day, month, year. If the year is B.C. it must be negative. /* public...
  • Getting Computer Name
    You can get the computer name from within the application. Declare the Win32 API modul on Declare -> Local External Functions Function bo...
  • Get a list of printers installed
    In this example, we populate a listbox with the printers name /* Get Printer List */ string printers[] int rtn, i, nbPrinters rtn = Registry...
  • Calling Oracle Stored Procs/Functions from PB
    Whenever you want to make a call to an Oracle stored procedure or stored function, a good approach is to first declare it as an external fun...

Categories

  • Database
  • DataWindow
  • PowerScript
  • Win32 API

Blog Archive

  • ▼  2008 (34)
    • ▼  March (14)
      • Retrieve an environment variable
      • Get a list of printers installed
      • List available ODBC datasources
      • How to get the current DBMS, Database or user thro...
      • Sorting Datawindow
      • Hexadecimal to Decimal
      • Julian Date
      • Hiding Application on Windows Taskbar
      • Hiding Desktop and Taskbar
      • Keeping Column into Array
      • Calling Oracle Stored Procs/Functions from PB
      • Re-initializing an Unbounded Array
      • Tracing on Running Application
      • Using Windows Scripting Host
    • ►  February (1)
    • ►  January (19)
Powered by Blogger.

About Me

Unknown
View my complete profile