How to create a timestamp in a batch (.bat) file?

You should use timestamps with some Microsoft installs like Microsoft SQL Server 2008. You can easily create a timestamp with a batch file.

1
2
3
4
5
6
@echo off
set date=%date:.=%
set timx=%time::=%
set time=%timx:,=%
set timestamp=%date%%time%
echo %timestamp%

Now you can use %timestamp% with your unattended SQL Server 2005 installation.

Tags: , ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply