1) CODE TITLE: ActiveX Simplified
2) AUTHOR NAME/NOTES:
Created by Gavin Delphia © 2007
All Rights Reserved
3) DESCRIPTION:
This script consitst of ActiveX functions that are accessed through javascript such as read and writting to files. Moving, copying, deleting, finding attributes of files. It can also list all files in a folder, get the computer user name, domain name, and computer name. Supports ascii to binary conversion and the reverse. It also has a function to launch any application found on a computer.
This library only works with internet Explorer and it is intended for use with Microsoft Hypertext Application or .hta
Errors and limited functionality may occur if used in a .html or .htm
[Call Format:] $funcname(target,parameters)
Every function either returns True, False, or the Requested Data.
For query functions such as does a $FileExist() and $FolderExist() true and false represent yes and no respectively.
The $OpenFile() function returns the documents contents if true or false if a error occurs.
All other functions return True for action executed or false for action failed.
$OpenFile(file) -
opens file and returns text
$GetFolderFiles(folder) -
Returns array of files in target folder
$GetFileBaseName(file) -
Returns just the name of the file without the path or file extension
$GetFileExtension(file) -
Returns just the file extension without the path or name
$GetFileName(file) -
Returns the file name followed by the extension. No path
$GetParentFolder(file) -
Returns the parent folder of any file or folder
$CreateFile(file,datatowrite) -
Creates a file with specified data
$CreateFolder(folder) -
Creates a folder
$DeleteFile(file) -
Deletes File
$DeleteFolder(folder) -
Delets Folder
$FileExist(file) -
Returns true if file exists and false if it does not
$FolderExist(folder) -
Returns true if folder exists and false if it does not
$CopyFile(file,destionation) -
Copies file to the destionation
$CopyFolder(folder,destination) -
Copies folder to the destination
$MoveFile(file,destination) -
Deletes file from original location and moves to destination
$MoveFolder(folder,destination) -
Deletes folder from original location and moves to destination
$GetComputerName() -
Returns the name of the computer
$GetUserName() -
Returns the name of the user
$GetUserDomain() -
Returns the domain of the user
$LaunchApp(target_app) -
Launches the specified application. Eg $LaunchApp('cmd.exe')
$ToBinary(string) -
Returns string converted to binary
$ToAscii(string) -
Returns string converted to ascii
4) URL TO CODE:
or, ATTACHED BELOW (see #3 in guidelines below):
Bookmarks