De KiXtart à Python: les fonctions

Petit guide en anglais de traduction de scripts KiXtart vers Python.

Functions

KiXtart Python equivalent Description
Abs Returns the absolute value of a number
AddKey Add a key to registry
AddPrinterConnection Add a connection to a network printer (NT family only)
AddProgramGroup Create a new program group
AddProgramItem Add/replace an item in current program group
Asc Returns ASCII code of character
AScan Searches an array for a specific expression
At Place the cursor at the place indicated
BackupEventLog Backs up an NT event log
Box Draws a text box
CDbl Casts an expression to a variant of subtype Double
Chr Returns ASCII representation of numeric value
CInt Casts an expression to a variant of subtype Integer
ClearEventLog Clears an NT event log
Close Closes an ASCII file opened with OPEN
CompareFileTimes Compares the file date and time of two files
CreateObject Launches the COM/OLE automation server
CStr Casts an expression to a variant of subtype String
DecToHex Returns the HEX equivalent given a decimal value
DelKey Deletes a key from registry
DelPrinterConnection Remove a connection to a network printer (NT family only)
DelProgramGroup Deletes a program group
DelProgramItem Deletes a program item from a program group
DelTree Deletes a key from registry, including subkeys
DelValue Deletes a value entry from the registry
Dir Enumerates directory names
EnumGroup Enumerates the names of global groups the user is member of
EnumIpInfo Enumerates TCP/IP information of network adapters
EnumKey Enumerates the names of registry keys
EnumLocalGroup Enumerates the names of local groups the user is member of
EnumValue Enumerates the names of registry values
Execute Executes a piece of script
Exist Checks if a file exists
ExpandEnvironmentVars Expands environment variables within a string
Fix Removes the fractional part of number and returns the resulting integer value
FormatNumber Returns an expression formatted as a number
FreeFileHandle Returns an available file handle number
GetCommandLine( ) Returns the command line used to execute KiXtart
GetDiskSpace Returns free disk space (in Kbytes)
GetFileAttr Retrieves attributes of a file
GetFileSize Returns the size (in bytes) of a file
GetFileTime Retrieves the date & time of a file
GetFileVersion Returns the version string of a file
GetObject Gets a COM object from a file stored on disk
IIF Immediate IF
InGroup Checks for membership of user of specified group
InStr Searches for a string within a string (left to right)
InStrRev Searches for a string within a string (right to left)
Int Removes the fractional part of number and returns the resulting integer value
IsDeclared Returns a Boolean value indicating whether a variable has been declared
Join Returns a string created by joining a number of substrings contained in an array
KbHit Checks the console for keyboard input
KeyExist Checks for the existence of a registry subkey
LCase Returns string in lower case
Len Returns length of a string
Left Returns X characters from the left side of a string
LoadHive Load a registry hive
LoadKey Loads (overwrites!) key (sub keys and values)
LogEvent LogEvent
Logoff Logs current user off
LTrim Strips leading spaces from string
MemorySize Returns memory statistics, in Megabytes
MessageBox Displays a standard Windows dialog box
Open Opens an ASCII file
ReadLine Reads a line from an ASCII file opened with OPEN
ReadProfileString Read string from an .ini file
ReadType Returns the data type of a registry value
ReadValue Returns the data from a registry value
RedirectOutput Redirects all output to a file
Right Returns X characters from the right side of a string
Rnd os.urandom(n) Returns a pseudo random number
Round Returns a number rounded to a specified number of decimal places
RTrim Strips trailing spaces from string
SaveKey Saves entire key (including sub keys and values)
SendKeys Sends keystrokes to the focused application
SetConsole Change display mode of console
SetDefaultPrinter Sets the default printer
SetFileAttr Sets attributes of a file
SetFocus Sets focus to a specific application
SetOption Enables/disables global settings of the interpreter
SetSystemState Changes the (power) state of the local system
SetTitle Sets the Window title of the current console
SetWallpaper Sets the current wallpaper
ShowProgramGroup Change display status of a program group
ShutDown Shutdown or reboot local or remote system
SidToName Translates a Security Identifier (SID) into a name
Split Splits a single string into an array given a delimiter
SRnd Sets the starting point for generating pseudorandom integers
Substr Returns a substring from a string
Trim Strips leading and trailing spaces from a string
Ubound Returns the largest available subscript for an array
UCase Returns string in upper case
UnloadHive Unload a registry hive
Val Returns the numerical value of a string
VarType Returns an integer value indicating the subtype of a variable
VarTypeName Returns a string that provides type info. about a variable
WriteLine Write a line of text to a file
WriteProfileString Write string to an ini-file
WriteValue Write single value to registry
Macros
@Address Address of the network adapter
@Build Build number of the operating system
@Color Returns the current console color setting
@Comment User comment (Description field in User Manager)
@CPU Name of the CPU (e.g.: « Intel Pentium III »)
@CRLF Returns a carriage-return line-feed combination
@CSD CSD information (eg: « Service Pack 2″)
@CurDir Current directory
@Date Date (in the format YYYY/MM/DD)
@Day Day of the week (Monday, Tuesday, etc.)
@Domain Domain or workgroup the computer belongs to
@DOS Version of Windows NT
@Error Return code of the most recent command or function. A return code of 0 means the command or function was successful. Any other value indicates an error.
@FullName Full name of current user
@HomeDir Short name of the directory part of home directory
@HomeDrive Drive letter of drive containing home directory
@HomeShr Server and share name part of home directory
@HostName Fully qualified TCP/IP host name (including TCP/IP domain name)
@InWin Operating system: 1 = Windows NT; 2 = Windows 9x
@IPaddress0
@IPAddress1
@IPAddress2
@IPAddress3
TCP/IP address
@KiX Version of KiXtart
@LanRoot Directory where network software resides (usuallySystemroot\System32)
@LDomain Logon domain
@LDrive Drive that is redirected to \\logonserver\NETLOGON
@LM Version of network software
@LogonMode If 1, indicates that KiXtart assumes to be running during the logon sequence
@LongHomeDir Long name of the directory part of home directory
@LServer Logon server
@MaxPWAge Maximum password age (Note: if passwords are set not to expire, this value is set to ((unsigned long)-1) (or 0xFFFFFFFF in hex). This evaluates to 4294967295 decimal).
@MDayNo Day of the month (1-31)
@MHz Approximation of the CPU speed (not available on Windows 9x)
@MonthNo Month number, beginning with January (1-12)
@Month Name of the month
@MSecs Milliseconds part of the current time
@OnWoW64 Returns a 1 if KiXtart is running in the WOW64 environment
@PID Process ID of KiXtart (wkix32.exe or kix32.exe)
@PrimaryGroup Current user’s primary group
@Priv User’s privilege level (GUEST, USER, ADMIN)
@ProductSuite OS Suite
@ProductType OS type
@PWAge Password age
@RAS Number of active Remote Access Service (RAS) connections
@Result Returns command-specific information (e.g.: the drive letter of an automatic redirection command)
@RServer KXRPC server used for the current session
@ScriptDir Directory of current script
@ScriptExe Indicates the version of the KiXtart executable
@ScriptName Name of the current script
@SError Error text corresponding with @ERROR
@SID Current user’s Windows NT Security Identifier (SID)
@Site Name of the site in which the system resides
@StartDir Directory from which KiXtart was started
@SysLang Full English name of the language of the operating system specified in the format defined by ISO Standard 639. (example : “0413Dutch (Standard)”).
@Ticks Number of milliseconds elapsed since computer was last booted
@Time Current time (in the format HH:MM:SS)
@TsSession This macro will return a 1 if KiXtart is running in a Terminal Server session
@UserID Current user’s Windows NT user ID
@UserLang Full English name of the language selected by the current user specified in the format defined by ISO Standard 639. (example : “0413Dutch (Standard)”).
@WDayNo Days since Sunday (1 – 7)
@Wksta Computer name
@WUserID Current user’s Windows user ID
@YDayNo Days since January 1 (1 – 365)
@Year Current year

2 Responses to “De KiXtart à Python: les fonctions”


Leave a Reply