Search Tools Links Login

String Handling for File Operations

Posted: 2019-04-06
By: vb6boy
Viewed: 440

Filed Under:

VB6 Files and I/O, VB6 String Handling, VB6 Tutorials, VB6 Code Cache

Title Uploaded Size
basfile.zip 4/6/2019 9:09:53 AM 3,704

This is a module containing twenty useful functions for working with files, directories, drives, and volumes.

Notice

This content originally appeared on on extreme-vb.net. Permission from Bob Schwarz has been granted to included it here for archival purposes.

We can't reach the future without a bridge to the past.

The below table contains a list of the functions, along with a brief explanation of what each one does.

Function Name Description Input Output
FindExecutable Finds the executable associated with a file string string
ShellDelete Deletes a single file, or an array of files to the recycle bin variant array boolean
ShellWait Shell command and wait for completion string boolean
ExecuteWait Executes a function and waits for completion string boolean
AddBackslash Adds a backslash if the string doesn't have one already string string
Execute Executes a file with it's associated program integer, string boolean
GetFile Returns the file portion of a file + pathname string string
GetPath Returns the path portion of a file + pathname string string
GetSerialNumber Returns a volume's serial number String Long
GetShortPathName return the short path for a path + file string string
GetVolumeName returns the volume name of a given disk volume string string
SetVolumeName Sets the volume name. Returns true on success, false on failure strings boolean
GetSystemDirectory Returns the system directory String String
GetTempFileName Returns a unique tempfile name   string
GetTempPath Returns the path to the temp directory   String
GetWindowsDirectory Returns the windows directory   String
RemoveBackslash Removes the backslash from the string if it has one String String
sDriveType Returns the drive type if possible String String
GetDriveType returns the drive type, via API String Long
FileExists Determines whether the specified file exists String Integer

Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.