Browse - Programming Tips - What scripting languages does Windows natively support?
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
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)
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.
with quite a bit of trouble.