Batch file is one of the most useful tools in server performance monitoring or even some simple command execution. It simplify our job as we can always schedule a batch file to run under Windows Task Scheduler.
Of the the most obvious example is that you need to backup an output file to an achieve folder, you do not need a complicated program compiler like Microsoft Visual Basic or Visual Studio .NET to do the job. What you need is just a simple batch file that will copy the output file to a new location and rename it with today’s date or other prefix date format.

Display of date format in batch file

When i was just start to write a batch file, it took my quite a couple of minutes to figure out how to rename the text file with the date format i required. If you have the same problem as mine, below is the answer.
You can try it by opening our command prompt under your windows program file -> accessories -> command prompt.

If you type “echo %date%” in your command prompt, it will display today’s date by following your regional setting (“Mon 03/09/2007” for example).
What you need to do in order to display the date in format of yyyymmdd? Ok, what you need to do is just type “echo %date:~10,4%%date:~4,2%%date:~7,2%”, it will now display today’s date in yyyymmdd format (“20070309” in this example), and you can always manipulate the date format you desire by just changing its sequences.

If you would like it to display as ddmmyyyy, it shall be “echo %date:~4,2%%date:~7,2%%date:~10,4%”, simple isn’t it?

Technorati Tags : Command Prompt, Script, Windows

Popularity: 19% [?]

Technorati Tags: , ,

If you're new here, you may want to subscribe to my FULL RSS feed. Thanks for visiting!

Related Post:
  • 2 Simple Ways to improve Vista Performance
  • Reinitialise Microsoft Windows with SysPrep
  • Windows Vista ReadyBoost - Personal Experience
  • My first trial on Windows Live Writer…
  • Windows Live Writer…I love it


  • With the increasing popularity of Microsoft Virtual PC 2007 and VM Ware, do you know what are the reasons behind this for more and more people starts to use virtual PCs or Virtual Servers?

    Below are the reasons that i can think of as I’m of the users of virtual servers.

    1. It provides more flexibility. As long as your hardware can support, you can install multiple OS to your computer or server. You can use all this different OS in just one hardware and it saves your cost of buying or maintaining hardware. Will be most ideally used for testing environment.
    2. Preserve the state of virtual machine. You are able to create snapshots as an image, in case your software or application crashes and caused instability of  your OS, you can always reverse it back wit h the snapshots that you capture earlier. It saves your job for rebuilding or reinstalling the OS from scratch.
    3. Convenience. You can switch between operating systems easily in Microsoft Virtual PC 2007and VM Ware. Each and every virtual machine can have it’s own PC name and you can define the memory and space allocated for each virtual machine.
    4. Environment-Friendly effort to fully utilise your pc or servers. With  Microsoft Virtual PC 2007and VM Ware, you are able to fully utilise your pc or server hardware especially for testing environment without buying new hardware and it saves your electrical power consumption.
    5. Accelerate Development. With the ease to prepare virtual machines for testing, it increase the quality assurance for software or application release on multiple OS platform. Time-to-market reduced as time saved on installation and configuration.

    Technorati Tags: Virtual PC, VMWare, Microsoft

    Popularity: 27% [?]

    Technorati Tags: , ,

    Related Post:
  • Top 5 Reason To Go For Server Virtualization
  • How much you know about network cable?
  • Microsoft Windows Refresh with NewSID
  • 8 dangerous consumer technologies in corporate reveal by Computerworld Malaysia.
  • Do you ever try to purchase clothes online?


  • « Previous pageNext page »