View Single Post
Old 05-29-2007   #40 (permalink)
beakmyn
root\.workspace\.garbage.
 
Join Date: Aug 2003
Posts: 4,808
Code:
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
  set dow=%%i
  set month=%%j
  set day=%%k
  set year=%%l
 )

set /A month=1%month% - 100 + 0

if %month%==1 set mon=Jan
if %month%==2 set mon=Feb
if %month%==3 set mon=Mar
if %month%==4 set mon=Apr
if %month%==5 set mon=May
if %month%==6 set mon=Jun
if %month%==7 set mon=Jul
if %month%==8 set mon=Aug
if %month%==9 set mon=Sep
if %month%==10 set mon=Oct
if %month%==11 set mon=Nov
if %month%==12 set mon=Dec

for /f "tokens=1-4 delims=.: " %%i in ("%time%") do (
 set hour=%%i
 set minute=%%j
 set second=%%k
 set hundredth=%%l
)

if %hour% LSS 10 set hour=0%hour%

SET filename=%computername%_%year%%mon%%day%-%hour%h_%minute%m_%second%s

now you get
computername-2007May29-15h_16m_23s.log

Why you ask? Because I'm going back to Montana next week and I want to be able to tell the difference between the files when I run it on the 2 public terminals again.
Attached Files
File Type: zip go.zip (23.0 KB, 6 views)
__________________
Daughter with arms inside shirt: "Daddy I'm not Armish"

┌──────────────────────────────┐
NS Icons Explained|et hoc genus omne
└──────────────────────────────┘
beakmyn is offline   Reply With Quote