Small
2010-08-29 17:56:45 UTC
I got annoyed a couple of days ago when herc erase the printer output that was still sitting there on startup. So I wrote a little add-on which will rename all these files I want to keep for a while. I don't really care for rhe puncher outpu at this time.)
I'd like to share this with the group:
@Echo off
IF %SETHERC%.==1. GOTO RUNIT
SET SETHERC=1
PATH c:/data/mvs380/hercules;%PATH%
:RUNIT
SET HERCULES_RC=c:/data/mvs380/conf/hercules.rc
SET HERCULES_CNF=c:/data/mvs380/conf/turnkey_mvs.conf
SET HERCULES_LOGO=c:/data/mvs380/hercules/my_herclogo.txt
hercules >log\hercules.log
pause
set x1=%date:~-4%
set x2=%date:~-10,2%
set x3=%date:~-7,2%
set yyyymmdd=%x1%-%x2%-%x3%
set x1=%time:~-11,2%
set y1=%x1:~0,1%
if "%y1%" == " " (
set x1=%x1:~-1%
)
set x2=%time:~-8,2%
set x3=%time:~-5,2%
set hhmm=%x1%-%x2%
set new-name=%yyyymmdd%_%hhmm%
@echo off
cd log
ren hercules.log %new-name%_hercules.log
ren hardcopy.log %new-name%_hardcopy.log
cd ..
cd prt
ren prt1-000e.txt %new-name%_prt1_000e.txt
ren prt2-000f.txt %new-name%_prt2_000f.txt
cd ..
echo renames dome!
What is does is it adds data and time in front of the file names, so hercules.log becomes 2010-08-29_13-01 (as example).
I hope it helps someone. Of couse you may have to make adjustments for your files and folders.
Have fun!
Roger
I'd like to share this with the group:
@Echo off
IF %SETHERC%.==1. GOTO RUNIT
SET SETHERC=1
PATH c:/data/mvs380/hercules;%PATH%
:RUNIT
SET HERCULES_RC=c:/data/mvs380/conf/hercules.rc
SET HERCULES_CNF=c:/data/mvs380/conf/turnkey_mvs.conf
SET HERCULES_LOGO=c:/data/mvs380/hercules/my_herclogo.txt
hercules >log\hercules.log
pause
set x1=%date:~-4%
set x2=%date:~-10,2%
set x3=%date:~-7,2%
set yyyymmdd=%x1%-%x2%-%x3%
set x1=%time:~-11,2%
set y1=%x1:~0,1%
if "%y1%" == " " (
set x1=%x1:~-1%
)
set x2=%time:~-8,2%
set x3=%time:~-5,2%
set hhmm=%x1%-%x2%
set new-name=%yyyymmdd%_%hhmm%
@echo off
cd log
ren hercules.log %new-name%_hercules.log
ren hardcopy.log %new-name%_hardcopy.log
cd ..
cd prt
ren prt1-000e.txt %new-name%_prt1_000e.txt
ren prt2-000f.txt %new-name%_prt2_000f.txt
cd ..
echo renames dome!
What is does is it adds data and time in front of the file names, so hercules.log becomes 2010-08-29_13-01 (as example).
I hope it helps someone. Of couse you may have to make adjustments for your files and folders.
Have fun!
Roger