View Full Version : Looking for batch file examples

03-03-2010, 09:12 PM

I'm looking for as many intermediate level batch file examples as possible that will work in an XP command line environment. The cooler the script the better.

Thanks in advance!

Speedy Gonzales
03-03-2010, 09:14 PM
And what do you want them to do?

03-03-2010, 09:24 PM
Anything, change colours in the window. Show txt, use commands &tc

Speedy Gonzales
03-03-2010, 09:38 PM
Do a search in google, thats why its there. Here's some examples (http://www.computerhope.com/batch.htm#03) and here (http://www.dostips.com/DtCodeBatchFiles.php). I would read first before you run it. Just in case it deletes something

03-03-2010, 09:42 PM
set yourvariable=value
echo Your text goes here
echo Data stored in yourvariable is %yourvariable%

Nice basic stuff :)

echo - Prints text to screen
set XX=YY - declares variable XX and sets value to YY
pause - stops execution and waits for a key
%variable% - uses data stored in variable

04-03-2010, 07:35 AM
Also check out Microsoft's built-in CScript & WScript tools - lets you do a heck of a lot more than "DOS"-style batch files - either in VB or JavaScript. There's lots of examples out there, also.

04-03-2010, 03:59 PM
This wouldn't be for a Uni project or similar by any chance would it?