@xinehp, welcome to MSFN - there's always going to be multiple ways to write a script, and multiple languages or script environments/parsers to do it in. And it's also worth noting that Java and JavaScript (while both contain the word java) are in no way related. JavaScript, VBScript, PowerShell, and .cmd/batch file execution are all native to Windows 7 / Server 2008 R2. It appears there are multiple scripts in this thread, in multiple parsers and languages which will achieve what you would like to achieve. Let us know which one (or ones) work for you, and remember that using a specific language or parser to write a script is only easy because you know how to use it. I must reiterate that while you can use a .cmd in Windows 7, you should consider learning things like VBscript, Javascript, and PowerShell for administrative scripts simply because they're far more powerful, and they are all (frankly) very easy to use once you learn how to write for them. Yeah, I'm beginning to understand that. I'm just victimized by academia's obsession with Java Learning another language is definitely on the todo list, but I only have a 1-core brain. I must apologize to coffefiend for completely ignoring his solutions, I'm incredibly less knowledgeable about Windows than I thought, and his powershell line is freaking elegant. I'm still using my knowledge from 4 years ago writing .cmds to mess with the computers at high school I didn't know powershell existed, and I didn't think vbscript came with a native compiler. Thanks MSFN, I was initially expecting very little replys, from experience on other forums, but you guys are incredibly active (especially mods) and got it in no time, well done.