Skip to main content

An A-Z Index of Windows Scripting Host commands (WSH/VB Script)

Arguments, display - WshArguments.Item (also Count and length)

Command, cscript - Run a VBS/WSH Script
Command, .Run command
Command, .Exec execute command
Command, .AppActivate activate running command

Drive Map - .MapNetworkDrive
Drive Map, list - .EnumNetworkDrives
Drive Map, remove - .RemoveNetworkDrive

Echo text .Echo
Echo text to StdOut.Write
Echo, popup .Popup
Environment, read env variables - .Environment
Environment, expand env variables - .ExpandEnvironmentStrings
Environment, delete env variables - .WshEnvironment.Remove
Environment, echo .ComputerName
Environment, echo .UserName
Environment, echo .UserDomain

Log an item in the Event log .LogEvent

Object, create - .CreateObject
Object, get - .GetObject
Object, disconnect- .DisconnectObject

Path of wscript.exe - .Name
Path to current directory - .CurrentDirectory
Pathname of wscript.exe - .FullName
Pathname of script being run - .ScriptFullName
Path to desktop,start menu.. - .SpecialFolders
Printer, add printer - .AddPrinterConnection
Printer, add Network printer - .AddWindowsPrinterConnection
Printer, list printers - .EnumPrinterConnections
Printer, set default printer - .SetDefaultPrinter
Printer, remove printer - .RemovePrinterConnection

Quit - .Quit

Registry, delete - .RegDelete
Registry, read - .RegRead
Registry, write - .RegWrite

Send Keys - .SendKeys
Shortcut,create - .CreateShortcut
Sleep - .Sleep

text input - .ReadLine
text output - .Write
Version of wscript - .Version

Syntax
Variables, Functions, Operators,
Conditional and looping Statements.

Examples:
DriveMap.vbs - Connect to a network file share.
qchange.vbs - Re-assign network printer connections
compinfo.vbs - List Computer properties (as shown in ADUC)
userinfo.vbs - List User properties (as shown in ADUC)
datetime.vbs - Get Date, Time and daylight savings
uname.vbs - List user's simple name when called with a Distinguished Name
Localadmins.vbs - List local administrators across a network domain

All the syntax on this page assumes you have Windows Scripting Host version 5.6 (as supplied with Windows XP.) Examples are in VB Script.
Windows Scripting Host 5.7 is also now available.

Comments

Popular posts from this blog

Word to PDF Convertor

 A Word document may be easily converted to a PDF file However, what happens if you need to convert a ton of Word files into PDFs? It will take a long time to open every file by hand and save it to PDF.  You may quickly and easily convert large amounts of Word to PDF with the help of this method. And without utilizing any outside tools either. Ms. Word is all you need. Copy the following code into Notepad or Notepad++, then save the file as "PDF.js" in a folder var obj = new ActiveXObject("Scripting.FileSystemObject"); var docPath = WScript.Arguments(0); docPath = obj.GetAbsolutePathName(docPath); var pdfPath = docPath.replace(/\.doc[^.]*$/, ".pdf"); var objWord = null; try {     objWord = new ActiveXObject("Word.Application");     objWord.Visible = false;     var objDoc = objWord.Documents.Open(docPath);     var format = 17;     objDoc.SaveAs(pdfPath, format);     objDoc.Close();     WScript.Echo("Saving '" + docPath + "'

BACKUPPC INSTALLATION AND CONFIGURATIONS

BACKUPPC INSTALLATION AND CONFIGURATIONS BackupPC is a backup solution that can be configured to back up remote Linux and Windows systems. It can use a variety of different protocols and has a flexible scheduler to coordinate full and incremental backups. I have installed this on ubutnu 14.04 LTS and its running fine for me for a long time since the installation Open a terminal and enter the following commands: sudo apt-get update sudo apt-get install backuppc During the installation, you will be asked what kind of mail server configuration is needed. We can select the "Local only" option, because we will not be configuring internet-aware mail ???????? Postfix Configuration ????????? ? General type of mail configuration: ? ? ? ? No configuration ? ? Internet Site ? ? Internet wi

Flash For EVONY 2021

Flash is now officially dead.   with this way you can still use Flash. if you have any problem while installing or working on this please feel free to contact me to help you first we have to go to pale moon https://www.palemoon.org/ Download and install PaleMoon then lets go to adobe archive page  https://web.archive.org/web/20200630185339/https://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html go to bottom of the page until you find the  Flash Player archives this site is little bit slower than others  Download this version,after May it is not working (Released 5/12/2020)  Flash Player 32.0.0.371  (425 MB)    https://web.archive.org/web/20200630185339/https://fpdownload.macromedia.com/pub/flashplayer/installers/archive/fp_32.0.0.371_archive.zip Unzip the archive and install the flash player for windows, Goto control panel and find the flash adon there Click on never check for updates  then open your c drive  and search where adobe is get installed. in here i am usi