The Rundll32 Program
A nifty little application on your Windows machine lets your scripts call methods and properties inside DLLs to perform a variety of system tasks without intervention. All you need to do is call rundll32.exe from your WSH script and pass the necessary parameters.
For example, would you like your script to format a floppy disk? Create a standard WScript::Shell object, then call the Shell::Run method to run the Format command from the shell. Listing 4 shows FormatFloppy.vbs, which creates a Wscript::Shell object called objWSH, then calls rundll32 .exe. The script passes the parameters shell32.dll (the name of the DLL that will run the Format command) and SHFormatDrive (the method in the DLL that formats a drive). Because someone could modify this script to format hard disks, the usual caveats about limiting access to your crucial machines apply here.
If you need to copy a disk, use DiskCopier.vbs. Web exclusive Listing 3 shows this script. DiskCopier .vbs is similar to FormatFloppy.vbs, but DiskCopier.vbs opens diskcopy.dll and uses the DiskCopyRunDll method. . . .