The scripts have the same usage but is written using different approach depending your needs:
- Script 1: Batch command [Date /T]
- Script 2: VBScript
- Script 3: Powershell
How To Include In Script
1. You can either embed the script block in your own script.
2. You can save the script in the file and include "CALL" command to activate.
eg. CALL YLNotes_ScriptLibrary_Windows_GenericDateValue_0001.cmd
Date Value Usage
The Date Value is prefix with "d' which refers to date.
The detail reference of date usage are shown below table
Example of Date Value in Windows Batch Scripting:
1. To generate date timestamp "YYYYMMDD"
ECHO %dYYYY%%dMM%%dDD%
2. To generate Today Date with format "dd-MM-YYYY" like "01-Mar-2014"
ECHO %dDD%-%dMMM%-%dYYYY%
3. To generate Today Date with format "dd/MM/YYYY" like "01/03/2014"
ECHO %dDD%/%dMM%/%dYYYY%
4. To generate Today Date with format "d/M/YY" like "1/3/14"
ECHO %dD%/%dM%/%dYY%
ECHO %dD%/%dM%/%dYY%
Script Library
No comments :
Post a Comment