Dave's Brain

Browse - Programming Tips - What scripting languages does Windows natively support?

Date: 2009aug18
OS: Windows
Keywords: native

Q.  What scripting languages does Windows natively support?

A.  I know of:

- Batch Scripts (.bat file)
- Visual Basic Script (.vbs script)
- PowerShell (.ps1 files.)  in Windows Server 2008 and later
- javaScript (.html or .js files) running in your browser

Comments...

The batch scripting language is very limited but at least you can
run any command, rename, copy files, etc.

Visual Basic Script is more like a real language.  You can access COM
objects with it.  For example:

set wmiService = GetObject ("winmgmts:") set PD0_Set = wmiService.ExecQuery("select * from Win32_DiskDrive where DeviceID = '\\\\.\\PHYSICALDRIVE0'") s = "" for each item in PD0_Set s = s & "-----" & chr(10) s = s & "Id: " & item.DeviceID & chr(10) s = s & "Model: " & item.Model & chr(10) s = s & "Manufacturer: " & item.Manufacturer & chr(10) s = s & "Signature: " & item.Signature & chr(10) s = s & "TotalHeads: " & item.TotalHeads & chr(10) next MsgBox s, 0,"Disk Zero"
Since since the .vbs extension is associated with viruses you may need to zip and/or rename your scripts when mailing them to a colleague. PowerShell is good but not natively supported on all Windows. javaScript runs in a browser so can only reach out to local files with quite a bit of trouble.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.