Give me space. Stop shining

minime28

Tuesday, March 02, 2010

Symbols in batch files

'>' and '<' are special characters in command prompt. They means input and output redirect. So they can't be directly echoed in command prompt. You need to escape them with '^'. 

C:\>echo <
The syntax of the command is incorrect.

C:\>echo ^<
<

This is mentioned in http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/windowsxp/home/using/productdoc/en/ntcmds_shelloverview.asp

The following characters are special and have to be escaped:
<, >, |, &, or ^,

via MSDN blog

Labels:

0 Comments:

Add a comment

Sunday, February 28, 2010

Simple text logging with a batch file

@echo off
Cls
set /p m=Task:
echo %DATE%^|%TIME%^|%m% >> log.txt

via enrri.blog

Lifehacker - xls quicklogger




Labels: ,

0 Comments:

Add a comment

Tuesday, February 16, 2010

Appending a date to files

7z.exe a "c:\temp\onenote_%date:/=%.zip" "C:\Users\\AppData\Local\Microsoft\OneNote\12.0\Backup\Personal Notebook"

A simple way of appending a date to a backup file. It works by stripping out the '/' symbol from the date, which may not seem seem like much but always had me stumped. I found a few date scripts on the web but those were just too complicated for me.  This will be very useful for backups of Onenote, great program it might be but could really use an export data function. The program backup data automatically by default to the hidden application data folder. How difficult would it be to add that option and let folks backup their data easily? 

Another way would be to use Namedate , a program that appends dates to a specified program. 

Labels:

0 Comments:

Add a comment

Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »