troubleshooting Question

MS-DOS batch that works in W2k and up - but not Win95

Avatar of ToddRod_Taylor
ToddRod_TaylorFlag for United States of America asked on
Windows BatchMicrosoft DOSWindows OS
10 Comments1 Solution276 ViewsLast Modified:
I have this batch working magnificantly in Windows 2000 and 2003 and XP with the help of the Experts here; but not in Win95!  What do I need to change in order to make this batch work under Win95, and, determine which OS it is running under and work accordingly?  I will never use anything older that Win95.

I suspect it is the for statements?

@echo off
setlocal

CD \RMS\C001\DL
COPY C:\GEMCOM\BACKUP\01VERIFO.DAT C:\RMS\C001\DL\01VERIFO.DAT
COPY C:\RMS\C001\DR\DRSA* C:\RMS\C001\DL\DRSA*

for /f "tokens=1,* delims==" %%a in ('type "C:\PDIMSG32\PDIMSG32.PMC" 2^>NUL') do if /i "%%a"=="Storeid" set locvar=%%b&goto FOUNDIT

echo NO store ID !!
pause
goto :EOF

:FOUNDIT
for /F "tokens=1-4 delims=/- " %%a in ('date/T') do set date=%%d%%c%%b
for /F "tokens=1-4 delims=/- " %%a in ('date/T') do set /a DAY=%%b

set /a YESTERDAY = DATE - 100

if  "%DAY%" == "1" (
     set YESTERDAY=%DATE%
)else (
     set YESTERDAY = DATE - 100
)

set drdate=%yesterday:~6,2%%yesterday:~4,2%
set locvar=%locvar:~-3%
echo %locvar%
echo %drdate%

for /f "delims=" %%a in ('dir /b /a-d DRSA*.') do call :PROCESS "%%a"
goto :EOF
:PROCESS
set FileName=%~nx1
rename "%FileName%" "%locvar%%drdate%.P%FileName:~4%"
:EOF

ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 10 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 10 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004