Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wonder what scripting languages is most used as logon scripts these days. Is people still hacking away in batch-file files or vbscripts, or do you use PowerShell or something completely different?

Personally, I have pretty good experience with vbscript, it works across almost all Windows versions, but PowerShell looks sweet and might be an option going forward.

So, what is your preferred scripting language for logon scripts, and why? And if you can, please share some of the brilliant things you do in your logon scripts.

Regards, Egil.

share|improve this question

Although we use powershell on our servers, we use vbscript on the clients to login. VBscript is installed by default and we use it instead of CMD batch files because of the access to wmi and specifically we use it to install all the appropriate printers.

share|improve this answer

Your title strongly suggests a unix environment (or maybe its just me :-). Could be more precise if you add the phrase "for windows" at the end of the question.

Sorry for writing this as an answer, wanted to make it a comment but i just started on serverfault and don't have sufficient credits to add a comment.

share|improve this answer
Doh, I never though of that. Noted and fixed. – Egil Hansen Jun 5 '09 at 10:51

For now, our logon scripts still are winNT batch files, and will stay for quite a while. The reason for being so conservative is how fundamentally important the scripts are, and how easy it would be to screw up the distibution of the proper interpreter on all computers.

If and when Windows 7 replaces Windows XP, imho, it will become feasible to switch the logon scripts to PowerShell.

But even before then, it is possible to branch to other scripts (perl etc) from the logon.cmd after doing the proper tests.

share|improve this answer

I've used KIX for about 15 years. It's fast, easy, and just about anyone can learn it. Which is the best part as far as I'm concerned as I then don't have to be the one maintaining the scripts.

Also there is a great free kix editor Kixtarter

share|improve this answer

I use a combination of VBScript, WMI and ADSI. I am also starting to play with Powershell to see what it can do in the login scripts.

share|improve this answer

While Powershell is a fantastic scripting tool, and I use it all the time on servers, its a pain to use for scripts on client machines because its not installed everywhere, like VBscript is. Yes it could be rolled out by group policy but a lot of companies don't want to do that just to make life a bit easier for sysadmins!

Once organisations move to Windows 7 and Powershell is installed by default, then things can start to get interesting,

share|improve this answer
I haven't actually tried Powershell for login scripts because my guess is that they would be too slow. Each time a Powershell script runs the .Net framework also has to load up. I heard of one sys admin who changed all his login scripts on his Citrix servers to Powershell and almost crippled the servers when the users started to log in. I would be interested to hear what people need in a login script from Powershell that couldn't be done via VBscript. – fenster Sep 4 '09 at 1:24

I've also always used VBScript\WMI\ADSI as well as CMD batch files. I've deployed (firm-wide) and used Powershell plenty but not in login or startup scripts as Powershell is great, I love it, but it's slow compared to .vbs or .cmd and I don't want to slow down bootup\login times.

share|improve this answer

I'm using batch too. I try to keep my logon scripts as simple as possible. Most of the time it's only for connecting network drives or printers...

share|improve this answer

It's a mix of batch and VBScript at the moment.

I have been playing with PowerShell recently, but even with the script execution policy set to Unrestricted it will prompt when running a script from a UNC path such as \\domain.local\sysvol\...\file.ps1, which is not ideal for use as a logon script.

For the moment I'll stick with VBScript and eventually I'll get around to doing it the right way, i.e. signing the PowerShell scripts.

For local use, e.g. ad-hoc or scheduled tasks, PowerShell does just fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.