Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Batch   (RSS)
I found that TechNet has references for the Windows command line utilities. Much of these are just a rehash of the help you'd get with /? but at least they're easier to read... This is a list of commands for Windows Server 2003 (most apply to Windows Read More...
0 Comments
Filed under: ,
Earlier , I tried to come up with a definitive list of illegal filesystem names, but it seems this is already documented. Who knew? http://support.microsoft.com/Default.aspx?id=74496 Read More...
0 Comments
Filed under:
For those of you who are more interested in the gritty details of command line redirection , RaymondC has posted a couple of great articles recently on his excellent The Old New Thing blog. The first discusses how (and more importantly, why ) the redirection Read More...
0 Comments
Filed under:
The other day, someone posted a message at work asking for a way to find out the drive letter for partition 1 on the first disk. The first response offered this: C:>echo list volume | diskpart Microsoft DiskPart version 5.1.3565 Copyright (C) 1999-2003 Read More...
2 Comments
Filed under:
Many languages provide a mechanism to make their code look pretty. VBScript, for example, assumes one statement per line, but including an underscore at the end of the line indicates that your statement continues on the next line. Normal WScript.Echo Read More...
0 Comments
Filed under: ,
It's pretty easy to deal with up to 9 arguments in batch through built-in variables %1 through %9 . For example: echoargs.cmd @echo off echo %1 echo %2 echo %3 echo %4 echo %5 echo %6 echo %7 echo %8 echo %9 If you feed this A B C D E F G H I, you'll Read More...
1 Comments
Filed under:
Earlier , I used >nul 2>&1 to suppress the output of a command, and the question was brought up as to why this was "better" than just >nul . To understand what's going on, you need to know that there are two streams of output from any given Read More...
2 Comments
Filed under:
Here's something I'd never noticed until today, when I discovered it quite by accident. In general, to run a program in a different directory, you specify the path with backslashes, such as C:\WINDOWS\system32\notepad.exe . This should be no surprise. Read More...
3 Comments
Filed under:
There's a fine line between an assumption and a bug. If the assumptions are spelled out ahead of time, then it's not a bug if the script does what's expected, taking the assumptions into consideration. Having disclaimed that, then, here are some of the Read More...
0 Comments
Filed under:
In the previous post, there was a fair amount of code and basically no explanation... Here's how it breaks down: Naïve method: set FILENAME=basename-%RANDOM% CMD has a built-in variable called %RANDOM% . Simply put, it returns a random value between 0 Read More...
1 Comments
Filed under:
Someone today was asking how to create unique filenames. They had some process which ran in a loop, and they wanted to direct the output of that process to a file, but rather than always overwriting the same file, they wanted to keep history using distinctive Read More...
0 Comments
Filed under:
There are a couple of scripts that have been with me since the beginning of time. I don't use them that much anymore, but they occasionally come in handy. I'm always pleasantly surprised to find that I still have them when I need them. One makes files Read More...
2 Comments
Filed under:
Some scripts are complex and do lots of cool stuff. Others are simple and save a bunch of time. I have a couple of scripts which prove to be so useful that I don't know when I'm using them anymore. I tend to type faster than I think (or get my fingers Read More...
0 Comments
Filed under:
 
Page view tracker