Wrote a batch file just now to do some DB setup for a Whidbey application that needs some ASP.NET features like Membership and Personalization. So it has to call aspnet_regsql.exe a few times. I used to write a lot of UNIX shell scripts, so I forgot what the comment character was for .bat files (hint, it wasn't '#'). In fact, it's not a character at all, but the lovely 'REM'. Found this handy reference which includes the allowable commands:
- @
- ECHO
- Send messages to user
- Turn on/off output to user
- REM
- Comment out a line (short for remark)
- PAUSE
- prints "Press any key to continue..." and waits
- GOTO
- IF
- can be used to check if a file exists or if a command returned an error
- SHIFT
- shifts command line params (useful if you have a lot of them I guess)
- CALL
- run another batch file from this one; allows reuse
- FOR
- CHOICE
- Prompts the user with a menu of choices and accepts one
Obviously I'm not offering a ton of syntax here -- go to the reference for that.