views:

321

answers:

12

I want to know what are the options to do some scripting jobs in windows platform. I need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools? What other functionality does windows scripting tools offer? Can everything that can be done using the Windows GUI be done using a scripting language?

+5  A: 

I think Windows PowerShell from Microsoft is the current favourite for this sort of thing.

David Sykes
+1  A: 

It might be worth looking at the prerelease of version 2.0. A lot of stuff has changed:

http://blogs.msdn.com/powershell/archive/2007/11/06/what-s-new-in-ctp-of-powershell-2-0.aspx

Mark Ingram
A: 

Windows Scripting Languages

Also take a look at PowerShell

aku
A: 

CScript ? I remember seeing something like that.

Gishu
+1  A: 

How about installing a windows version of Python, Perl or your favorite language? These should offer all the functionality you need.

cschol
A: 

Powershell is nice, but it's an extra thing you have to install. Not standard in almost any windows installation. So, if it's just for your own use, then powershell should be fine. If you need the scripts to run on the computers of the general population, for instance, as part of a piece of software you are producing, it may not be the best option.

If you are ok with an extra thing you have to install, you might want to check out cygwin. This allows you to have a full Linux bash command line and all the associated tools at your disposal.

If you need something included in a default windows install. There's the windows command line (cmd.exe). Which has some functionality, but is very deficient compared to what's available in Linux. The other, probably worse problem, is that there isn't much out there in the way of documentation.

You might also be interested in VB Script (flame away). VB Script should work on almost any recent standard windows install, and is a lot more functional than the command line.

Kibbee
A: 

I have cygwin installed, so I can run bash shell scripts for my automatization needs. Besides, when I need stuff running moreless natively on Windows, I use a combination of batch + jscript (runs on cmdline if you have Visual Studio.Net installed, just call "cscript XXX.js").

cjanssen
A: 

Yesterday I could have repaired this for you ;)

What all are the tools/languages for windows shell scripting?

Would read better as

What tools and languages are available for windows shell scripting?

sparkes
+1  A: 

Batch files are the most portable, but doing complicated things can get hard (very hard).

Powershell is incredibly - um - powerful, but the installed domain at the moment is only slightly more than those people who like using powershell and servers they administer. If you control the machines you're scripting on and can mandate that powershell is installed, powershell is the way to go. Otherwise, batch files are the best way.

Powershell lets you do anything which can be done, but some things will be harder than others :)

(Seriously, if you want to control a windows GUI app from a script, you're going to have a lot of pain unless the app supports scripting itself, or you want to start posting messages to dialog controls and screen scraping the dialog to check for success.)

James Ogden
A: 

Scripting is a blast.

Personally I like to write some evil little batch files. You can find a command line program to do just about anything. I prefer Batch files mostly because they are portable from one machine to another with at most a zip with a few unix tools (SSED, GREP, GAWK). there is a commandline REG.Exe that can even do Registry changes and reads. You can parse output from commands with a "FOR /f" loop.

PowerShell does have more... err.. Power (2nd post I wrote that in, but I can't help it.)

If you want to look at windows automation check out AutoHotKey.

What are you trying to automate? That may help us narrow down what would be helpfull.

  • Josh

EDIT: for the record I typed that at the same time as @jameso If someone at work hadn't asked me a question, I may have posted before him. I did get a bit of a shiver at the similarity of the post though....

Josh Miller
A: 

@sparkes, thanks for pointing out.

Niyaz
A: 

I would recommend "Take Command" (JPSoft), which is more like "cmd.exe" than the PowerShell. We use here at ESSS for years.

Kaniabi