views:

121

answers:

4

What is a Windows scripting language that: does not rely on .NET and offers the most OOP support and has simplest deployment?

It doesn't necessarily need to be a scripting language; It can be in the form of a compiled executable, however it needs to be self contained--only ONE file, no DLL's and it cannot be declared to "include" other files. I cannot rely on the user having any .NET installed and it needs to be able to run on Windows 7 64 bit.

By "most OOP support", I basically mean anything that has better OOP support than VBScript.

A little context: Everything I have done thus far is in VBScript and writes a bunch of data into an .html file, which in the end is to be viewed by Internet Explorer. It also zips up a bunch of directories and files. It heavily relies on accessing the registry, file-system, and WMI (I can probably do without accessing WMI though, as long as I have good registry access).

I can bring myself to write in any language so long as it meets me ridonkulous requirements stated above.

I look forward to some good answers from those more experienced than I.

+4  A: 

Python has OOP Support. And no .Net. And pretty easy to install: double-click the MSI.

S.Lott
It doesn't meet his requirement of "only one file" and "can't be declared to 'include' other files". Python uses `import` for most functionality, which requires it to look up a particular module.
John Feminella
@John Feminella: with py2exe or similar you can surely wrap everything (python interpreter, used libs, code, data, etc...) into one self-contained executable. +1 for the Python answer: would be a very good choice given the presumptions imo.
ChristopheD
Ahh I was hoping someone would say Python! I think someone offers a COM module, too. However I need to iron out deployment--I would think that the user would need the interpreter engine installed and stuff.
jJack
@ChristopheD That's not completely reliable. For instance, you can load libraries dynamically, and if that's something your Python app uses, it will blow up at runtime. Still, I guess I agree that Python is a possibility, so +1.
John Feminella
Once Python is installed, a script can be single file. I have no idea if this meets the incomprehensible requirements "only ONE file, no DLL's and it cannot be declared to "include" other files"
S.Lott
It would be VERY interesting to wrap a huge Python script into a single EXE so that I can ship a SINGLE file to someone, have them run it, and return the output. However, this is yet another huge battle I am pursuing right now.
jJack
+3  A: 

Microsoft JScript

Justin Niessner
Note that this is essentially javascript for windows scripting, which is arguably worse for traditional oop than even vbscript.
Joel Coehoorn
@Joel - It may not be traditional OOP, but it does offer OOP.
Justin Niessner
Yes - I don't mean to detract and I did vote you up, but it cut to the heart of the question and so bore mentioning.
Joel Coehoorn
If I remember correctly at least JScript allows Inheritance, so a step up from VBScript I think
jJack
@Joel JavaScript has OOP: functions act as classes, variables can be private, it has inheritance, interfaces can be emulated, etc. I find it to be very OOP in nature, though not strict about it
Bob
@Bob I know it does, but it's not exactly what the OP is likely looking for, either.
Joel Coehoorn
I thought JavaScript cannot even read the registry. If I am correct, then unless it can query WMI (..doubt it), we have to trash JavaScript as the wrong tool for this job. At this point, I am still riding with VBScript, with scattered flirts with AutoIT.
jJack
@jJack JScript can query WMI: http://msdn.microsoft.com/en-us/library/aa393258(VS.85).aspx And it can do whatever VBScript can do, including create ActiveX objects and the like. It's also far, far more OOP than VBScript
Bob
Thanks, I am looking into this. what a horribly documented language. I don't even see "Class" being an effective keyword. This should be fun...
jJack
@jJack I recommend this: http://javascript.crockford.com/
Bob
JavaScript has no WMI support. JScript (the WSH version), does not support classes (see: http://stackoverflow.com/questions/2504855/how-do-you-set-up-your-jscript-not-jscript-net-development-environment).
jJack
A: 

PowerShell is superb. Of course, you should have .NET. But look: it's already installed on Windows 7 and Vista, is widely used and has tons of docs and samples on the net.

I definitely would use PowerShell; if I knew everyone had .NET
jJack
+3  A: 

I suggest AutoIt v3. It can be compiled to single exe, allows many things that VBS offers and many more. Has ability to build simple and complicated gui and works on all Windows systems (older ones are supported by older autoit v3 version, newest version supports win2k/xp and up). It supports both 32/x64.

Best of all is their forum. Much like SO where they help you with both simple and complicated tasks. It also has great helpfile which describes all commands and shows examples how to use them.

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!

AutoIt was initially designed for PC "roll out" situations to reliably automate and configure thousands of PCs. Over time it has become a powerful language that supports complex expressions, user functions, loops and everything else that veteran scripters would expect.

Features:

* Easy to learn BASIC-like syntax
* Simulate keystrokes and mouse movements
* Manipulate windows and processes
* Interact with all standard windows controls
* Scripts can be compiled into standalone executables
* Create Graphical User Interfaces (GUIs)
* COM support
* Regular expressions
* Directly call external DLL and Windows API functions
* Scriptable RunAs functions
* Detailed helpfile and large community-based support forums
* Compatible with Windows 95 / 98 / ME / NT4 / 2000 / XP / 2003 / Vista / 2008
* Unicode and x64 support
* Digitally signed for peace of mind
* Works with Windows Vista's User Account Control (UAC)

It may be not OO, but it can achieve your goals.

MadBoy
+1 for AutoIt. I use it all the time to get quick patches out. I'm able to write libraries, compile them all to a single Exe that doesn't require any particular framework, and I'm able to package files into the exe for deployment. Reading the registry, working with the filesystem, working with files... all child's play to AutoIt.
JohnForDummies