How to Use .Dll in VBS

How to Use .Dll in VBS thumbnail
Binary computer code in a DLL file.

A DLL file is a dynamic link library that contains programming processes that are available for use by other programs. The ability to call a subroutine in a DLL file from Visual Basic Script (VBS) greatly expands the capabilities of VBS.

Things You'll Need

  • Windows operating system
  • .DLL File
Show More

Instructions

    • 1

      Create a text file on your desktop and rename the file "AutoExist.vbs". It is important to name the file with the extension "vbs" as this is how Windows knows to run the file as a VB script.

    • 2

      Right-click the icon of the new file and select "Edit." Windows should open the file as an empty file in notepad. It may use a different editor, if one has been installed, but by default VBS files are edited with notepad.

    • 3

      Put this code in the file:

      dim fso, file

      Set fso = CreateObject("Scripting.FileSystemObject") ' Load the FileSystemObject

      ' from within the scripting dll

      file = "c:\autoexec.bat"

      if fso.fileexists(file) then ' Call a method of the object that resides in the dll

      MsgBox("AutoExec.bat Exists")

      end if

    • 4

      Save the file. You can keep notepad open to change the script as needed.

    • 5

      Double click the "AutoExist.vbs" file and windows will execute the script. If the file "c:\autoexec.bat" exists a message box will pop up, if the file doesn't exist nothing will happen.

Tips & Warnings

  • You can access Microsoft-, third-party- and custom-developed DLL files using this technique.

Related Searches:

References

Resources

  • Photo Credit code image by charles taylor from Fotolia.com

Comments

You May Also Like

  • How to Fix the MS32DLL.dll.vbs Virus

    The MS32DLL.dll.vbs computer virus tries to disguise itself by using a legitimate-sounding name. It's not really a Windows DLL file, but rather...

  • How to Read DLL Files

    DLL files are system files that are mainly associated with Dynamic Link Library, according to FileInfo.com, an online database of file extensions....

  • How to Call Visual Basic Dll From C

    Dynamic link libraries (DLLs) are small files used to share common functions. The Visual Basic programming language can be used to create...

  • How to Remove THE Dll Virus in My PC

    A .dll file, or Dynamic-link library file, is used by a variety of different programs on your computer, and typically you do...

  • How to Manually Remove the Tubby.dll Virus

    The Tubby virus can only be acquired through the use of older versions of Microsoft Internet Explorer. The virus sneaks into your...

  • How to Use Winsock.dll in Visual Basic

    Microsoft's .NET platform provides a variety of classes that you can use to perform networking tasks. However, if you need ultimate control...

  • How to Use Mshtml Dll

    Mshtml.dll is a Dynamic Link Library file created by Microsoft. The mshtml.dll file is responsible for rendering web pages viewed within Internet...

  • How to Create VBS Files

    VBScript (Visual Basic Scripting Edition) is a scripting language developed by Microsoft. To create VBS files, you will need to use a...

  • How to Use Dll in VisualStudio.net

    Linking Dynamic Link Library (DLL) files is an essential part of programming. In Visual Studio.NET, the process is handled using the workspace...

  • How to Add DLL Files

    Files with the .dll extension are Windows files known as Dynamic Link Library files. These files are often shared by numerous programs...

  • How to Load Windows XP Using the I386 Folder Files

    Windows XP is a versatile operating system, both in form and function. While an installation of XP would typically be accomplished via...

  • How to Make a VBS File

    Visual Basic Scripting Edition (VBScript) uses the VBS extension to identify itself. You can use Microsoft Notepad to create VBScript files without...

  • How to Create DLL Files

    Dynamic Link Libraries or DLL files are libraries of functions to which executable programs can link or refer to during run time....

  • How to Create a VBS Email

    One part of automation for websites and desktop applications is sending email to customers. You can automate the procedure using Visual Basic...

  • How to Open a DLL in Visual Basic

    Knowing how to use Dynamic-Link Library (DLL) in a Visual Basic.NET application is good knowledge to possess. A DLL is simply a...

  • How to Use a .DLL Injector

    DLL injection allows to run a program code within another Windows system process by forcing the download of a dynamic link library....

  • How to Check If a File Exists and Then Delete It in Python

    Python is a comprehensive, high-level programming language. When writing a Python script, you often need to work with files on the hard...

  • How to Delete the VBS Virus

    The VBS virus creates Autorun.inf files in root directories, making the virus execute whenever those directories are accessed. It is a notoriously...

Related Ads

Featured