WinBatch® Functions
A list of frequently used and extremely handy functions.
Notice: this is by no means a complete list of functions. There are many other WIL functions and also over 25 WIL Extenders available that contain lots of additional functions. For a complete list of functions. Download your evaluation copy of WinBatch today and see the Consolidated WIL Help file.
The evaluation copy of WinBatch allows non-licensed users a limited license to use our software on a 21-day trial basis.
Arithmetic FunctionsAbs( integer ) Char2Num( string ) Decimals( #digits ) Int( string/fp_num ) IsNumber( value ) Max( number [ ,number... ] ) Min( number [ ,number... ] ) Num2Char( integer ) Random( integer ) TimeAdd( datetime, datetime difference ) TimeDiff( datetime1, datetime2) TimeJulianDay( datetime ) TimeSubtract( datetime, datetime difference ) |
Array FunctionsArrayFileGet( filename [, null-char [, extra-alloc]] ) ArrayFileGetCsv( filename, flags [, delimiter [, extra-rows [, extra-cols]]] ) ArrayFilePut( filename, array [, write-undef] ) ArrayFilePutCsv( filename, array [, delimiter [, write-undef [, flags]] ) ArrayFromStr( string ) ArrayInsert( array, sub [, dim [, value]] ) Arrayize( list, delimiter ) ArrayLocate( array, value, [sub1, [sub2, [sub3, [sub4, [sub5]]]]] ) ArrayRedim( array, dim1 [, dim2 [, dim3 [, dim4 [, dim5 ] ] ] ] ) ArrayRemove( array, sub, [ dim ] ) ArraySearch( array, value [, options [, search-column[, start-sub[, end-sub]]]] ) ArraySort( array, [options, [sort-column, [start-sub, [end-sub]]]] ) ArraySwapElements( array, subA1, subA2, subA3, subA4, subA5, subB1, subB2, subB3, subB4, subB5 ) ArrDimension( dim1 [, dim2 [, dim3 [, dim4 [, dim5 ] ] ] ] ) ArrayToStr( array ) ArrInfo( array, request ) ArrInitialize( array, value ) |
Binary FunctionsBinaryAlloc( buffsize ) BinaryCopy(handle targ, offset targ, handle src, offset src, bytecount ) BinaryEodGet( handle ) BinaryEodSet( handle, offset ) BinaryFree( handle ) BinaryIndexEx( handle, offset, string, direction, match-case ) BinaryPeek( handle, offset ) BinaryPeekStr( handle, offset, maxsize ) BinaryPoke( handle, offset, value ) BinaryPokeStr( handle, offset, string ) BinaryRead( handle, filename ) BinaryReplace(bin-handle, search-string, replacement-string, match-case) BinarySort( handle, recsize, key offset, key size, flags ) BinaryStrCnt( handle, start-offset, end-offset, string ) BinaryWrite( handle, filename ) |
Clipboard HandlingClipGet( ) ClipPut( string ) Snapshot( request# ) |
COM / OLE FunctionsObjectConstantsGet( object ) ObjectConstToArray( constants ) ObjectCreate( progId, location ) ObjectEventAdd( object-reference, event-name, udf-name ) ObjectEventRemove( object-reference, event-name ) ObjectGet( moniker, progId ) ObjectType( variant-type, value ) ObjectTypeGet( variable-name ) |
dotNetObjectClrNew ( typename [, ctorparm,...] ) ObjectClrOption ( option-name, option-value ) ObjectClrType ( typename, value-reference ) |
Disk Drive ManagementDiskExist( drive letter ) DiskFree( drive-list [, format] ) DiskInfo ( request# ) DiskScan( request# ) DiskSize ( request# [, format] ) DiskVolInfo( root-path, request# ) |
Directory ManagementAskDirectory( prompt, browse-root, start-dir, confirm-prompt, flags ) DirChange( [d:]path ) DirExist( pathname ) DirGet( ) DirHome( ) DirMake( [d:]path ) DirRemove( dir-list ) DirSize( dir-name, flags [, format] ) DirWindows( request# ) ShortCutDir( name/CSIDL [, source [, add-slash]] ) |
Display and InputAskDirectory( prompt, browse-root, start-dir, confirm-prompt, flags ) AskFileName( title, directory, filetypes, default filename, flag ) AskFileText( title, filename, sort mode, selectmode [, selection-required]) AskItemlist( title, list, delimiter, sort mode, select mode ) AskLine( title, prompt, default answer [, format] ) AskPassword( title, prompt ) AskYesNo( title, question ) Dialog( dialog-name [, ignore-flag] ) Display( seconds, title, text ) Message( title, text ) Pause( title, prompt ) |
File ManagementExeTypeInfo( exename ) FileAppend( source-list, destination ) FileAttrGet( filename ) FileAttrGetEx( filename ) FileAttrSet( file-list, settings ) FileAttrSetEx( file-list, attributes, mode) FileBaseName( filename [, flag]) FileClose( filehandle ) FileCompare( filename1, filename2 ) FileCopy( source-list, destination, warning ) FileCopyAttr( source-list, destination, warning , attributes) FileCreateTemp( prefix ) FileDelete( file-list ) FileDigest( filename, algorithm, format ) FileExist( filename ) FileExtension( filename ) FileFullName( partial filename ) FileGet( filename [, null-char]) FileGetW( filename [, null-char]) FileInfoToArray( file-list [, flags]) FileItemize( file-list ) FileItemPath( file-list ) FileLocate( filename ) FileMapName( filename, mapping-data ) FileMove( source-list, destination, warning ) FileMoveAttr( source-list, destination, warning ) FileNameLong( filename ) FileNameShort( filename ) FileOpen( filename, mode [, Unicode [, timeout ]]) FilePath( filename ) FilePut( filename, string ) FilePutW( filename, Unicode string ) FileRead( filehandle ) FileRename( source-list, destination ) FileRoot( filename ) FileSize( file-list [ ,format] ) FileSizeEx( file-list [ ,format] ) FileTimeCode( filename ) FileTimeGet( filename ) FileTimeGetEx( filename, time-field ) FileTimeSet( list, datetime ) FileTimeSetEx( file-list, datetime, time-field ) FileTimeTouch( file-list ) FileVerInfo(filename, language-key, resource-string) FileWrite( filehandle, output-data ) FileYmdHms( filename ) InstallFile( filename, targname, default-targdir, delete-old, flags ) ShortCutDir( name/csidl [, source [, add-slash]] ) ShortcutEdit ( link-name, target, params, start-dir, show-mode [, shortcut-type] ) ShortcutExtra( link-name, description, hotkey, icon-file, icon-index [, shortcut-type] ) ShortcutInfo( link-name [, shortcut-type] ) ShortcutMake( link-name, target, params, start-dir, show-mode [, shortcut-type] ) |
Pipe FunctionsPipeClientClose( pipe-handle ) PipeClientOpen( pipe-name, timeout ) PipeClientSendRecvData( pipe-handle, data, read-timeout ) PipeInfo( request, pipe-handle ) PipeServerClose( pipe-handle, timeout ) PipeServerCreate( pipe-name, timeout ) PipeServerRead( pipe-handle, timeout ) PipeServerWrite( pipe-handle, data ) |
Pointer FunctionsPtrGlobalDefine( var ) PtrGlobal( var ) PtrPersistent( var, value ) |
Registry FunctionsRegApp( program-name, path ) RegCloseKey( keyhandle ) RegConnect( computer-name, handle [,remoteOSflag] ) RegCreateKey( keyhandle, sub-key string [,view-flag] ) RegDeleteKey( keyhandle, sub-key string [,view-flag] ) RegDelValue ( handle, subkey-string [,view-flag] ) RegEntryType( handle, subkey-string [,view-flag] ) RegExistKey( handle, subkey-string [,view-flag] ) RegExistValue( handle, subkey-string [,view-flag] ) RegLoadHive( handle, subkey, filename ) RegOpenFlags( flag ) RegOpenKey( keyhandle, sub-key string [,view-flag] ) RegOpenKeyEx( handle, subkey-string, mode, view-flag, reserved ) RegQueryBin( handle, subkey-string [,view-flag] ) RegQueryDword( handle, subkey-string [, flags] ) RegQueryEx( handle, subkey-string, delimiter, type [,view-flag] ) RegQueryExpSz( handle, subkey-string [,view-flag] ) RegQueryItem( handle, subkey-string [,view-flag] ) RegQueryKey( handle, index ) RegQueryKeyLastWriteTime( handle, subkey-string [,view-flag] ) RegQueryKeys( handle ) RegQueryMulSz( handle, subkey-string, delimiter [,view-flag] ) RegQueryQword( handle, subkey-string [,view-flag] ) RegQueryStr( handle, subkey-string [,view-flag] ) RegQueryValue( keyhandle, sub-key string [,view-flag] ) RegSetBin ( handle, subkey-string, value [,view-flag] ) RegSetDword( handle, subkey-string, value [, flags] ) RegSetEx( handle, subkey-string, value, delimiter, type [,view-flag] ) RegSetExpSz ( handle, subkey-string, value [,view-flag] ) RegSetMulSz( handle, subkey-string, value, delimiter [,view-flag] ) RegSetQword( handle, subkey-string, value [,view-flag] ) RegSetValue( keyhandle, sub-key string, value [,view-flag] ) RegUnloadHive( handle, subkey ) |
String HandlingChar2Num( string ) ChrGetCodePage( request ) ChrHexToString( hex-string ) ChrHexToUnicode( hex-string [,flag] ) ChrSetCodePage( code-page ) ChrStringToHex( string ) ChrStringToUnicode( string ) ChrUnicodeToHex( Unicode-string [,flag] ) ChrUnicodeToString( Unicode-string ) IsFloat( string ) IsInt( string ) IsNumber( value ) ItemCount( list, delimiter ) ItemCountCsv( line, flags [, delimiter] ) ItemExtract( index, list, delimiter ) ItemExtractCsv( index, line, flags [, delimiter] ) ItemInsert( item, index, list, delimiter ) ItemLocate( item, list, delimiter ) ItemRemove( index, list, delimiter ) ItemReplace( item, index, list, delimiter ) ItemSort( list, delimiter ) Num2Char( integer ) ParseData( string ) StrByteCount( string, request ) StrCat( string [ ,string ] ) StrCharCount( string ) StrClean( source-string, characters, replacement, match-case, mode ) StrCmp( string1, string2 ) StrCnt( string, sub-string, start-pos, end-pos, flags ) StrFill( filler, length ) StrFix( base-string, pad-string, length ) StrFixBytes( base-string, pad-string, length ) StrFixBytesL( base-string, pad-string, length ) StrFixChars( base-string, pad-string, length ) StrFixCharsL( base-string, pad-string, length ) StrFixLeft( base-string, pad-string, length ) StriCmp( string1, string2 ) StrIndex( base-string, sub-string, start, direction ) StrIndexNc( base-string, sub-string, start, direction ) StrIndexWild( string, pattern, start ) StrInsert (base-string, new-string, [pad-string [, start [, length]]]) StrLen( string ) StrLenWild( string, pattern, start ) StrLower( string ) StrOverlay( base-string, new-string, [pad-string [, start [, length]]] ) StrReplace( string, old, new ) StrScan( string, delimiters, startpos, direction ) StrSub( string, startpos, length ) StrSubWild( string, pattern, start ) StrTrim( string ) StrTypeInfo( string, flag) StrUpper( string ) |
System FunctionsAbout( ) AppExist( program-name [, flags [, retries]]) AppWaitClose( program-name [, flags [, retries]]) ComputerNameGet( format ) ComputerNameSet( new-computername, format ) Debug( mode [, init-string] ) DebugData( string, string ) DebugTrace ( requestcode [ ,parm1 [, parm2 ]] ) DirHome( ) DirWindows( request# ) DiskExist( drive letter ) DiskFree( drive-list [, format] ) DiskInfo( request# ) DiskScan( request# ) DiskSize ( request# [, format] ) DiskVolInfo( root-path, request# ) DllCall( dllfilename/dllhandle, returntype:entrypoint [ paramtype:param... ] ) DllCallCdecl( dllfilename/dllhandle, returntype:entrypoint [ ,paramtype:param... ] ) DllFree( dllhandle ) DllHinst( partial-winname ) DllHwnd( partial-winname ) DllLastError() DllLoad( dllname ) DOSVersion( level ) Drop( varname [,varname...] ) DropWild( variable/wildcard ) EndSession( ) Environment( env-variable ) EnvironSet( env-varname, newvalue ) EnvItemize( ) ErrorMode( mode ) Exclusive( mode ) Execute statement ExeTypeInfo( exefilename ) GetExactTime( ) GetTickCount( ) IntControl( request#, p1, p2, p3, p4 ) KeyToggleGet( @key ) KeyToggleSet( @key, value ) LastError ( ) MouseInfo( request# ) MsgTextGet( window-name ) NetInfo( request code ) RtStatus() SysParamInfo( request, value, ini-update ) Terminate( expression, title, message ) Version( ) VersionDLL( ) WinExeName( partial-winname ) WinIsDOS( partial-winname ) WinMetrics( request# ) WinResources( request# [, format] ) WinSysInfo( ) WinVersion( level ) |
Time FunctionsFileTimeCode( filename ) FileTimeGet( filename ) FileTimeGetEx( filename, time-field ) FileTimeSet( list, datetime ) FileTimeSetEx( file-list, datetime, time-field ) FileTimeTouch( file-list ) FileYmdHms( filename ) GetExactTime( ) GetTickCount( ) TimeAdd( datetime1, datetime2 ) TimeDate( ) TimeDayofWeek TimeDayofYear TimeDelay( seconds ) TimeDiff( datetime1, datetime2 ) TimeDiffDays( datetime1, datetime2 ) TimeDiffSecs( datetime1, datetime2 ) TimeJulianDay( datetime ) TimeJulToYmd( julian-date ) TimeSubtract( datetime, datetime difference ) TimeWait( datetime ) TimeYmdHms( ) |
Window FunctionsDllHwnd( partial-winname ) FindWindow( window class name ) WallPaper( bmp-filename, tilemode ) WinActivate( partial-winname ) WinActiveChild( partial-parent-windowname, partial-child-windowname ) WinArrange( style ) WinClose( partial-winname ) WindowOnTop( partial-winname, mode ) WinExeName( partial-winname ) WinExist( partial-winname ) WinExistChild( partial-parent-windowname, partial-child-windowname ) WinGetActive( ) WinHide( partial-winname ) WinIconize( partial-winname ) WinIdGet( partial-winname ) WinIsDOS( partial-winname ) WinItemChild( partial-parent-windowname ) WinItemize( ) WinItemizeEx( partial-winname, multiple, hidden [, return-type] ) WinItemNameId( ) WinItemProcID( process-id, flags, return-type ) WinName( ) WinPlace( x-ulc, y-ulc, x-brc, y-brc, partial-winname ) WinPlaceChild( x-ulc, y-ulc, x-brc, y-brc, partial-parent-winname, partial-child-winname ) WinPlaceGet( win-type partial-winname ) WinPlaceSet( win-type, partial-winname, position -string ) WinPosition( partial-winname ) WinPositionChild( partial-parent-winname, partial-child-winname ) WinShow( partial-winname ) WinState( partial-winname ) WinTitle( old-partial-winname, new-winname ) WinWaitChild( partial parent winname, partial child winname, timeout ) WinWaitClose( partial-winname [, timeout] ) WinWaitExist( partial-winname, timeout ) WinWaitReady( partial-winname, timeout ) WinZoom( partial-winname ) |
UAC FunctionsUacElevationLevel ( ) UacExePromptTest ( programname ) UacManifestSettings ( request ) |