- Jun 25, 2001
- 29
- 0
- 0
ok Here is the cituation. I had this .bat file that I used to zip up some file and automatically add the date to the end of the file name:
example:
backup 01-20-2000.zip
backup 01-21-2000.zip
backup 01-22-2000.zip
etc......
It works great under windows98 but when I tried it under XP it had problems.
Here is the bat file:
-----------------------------------------
:: gdate.bat (GetDATE)
@ECHO off
SET gdate1=
ECHO SET date=%%3>%temp%.\%%gdate1%%.bat
DIR/A-D/-W/L/-P %temp% | FIND "%%gdate1%%" >%temp%.\%%gdate2%%.bat
SET gdate1=%temp%.\%%gdate1%%
CALL %temp%.\%%gdate2%%.bat
SET gdate1=
DEL %temp%.\%%gdate?%%.bat
pkzip "c:\temp\backup %date%.zip" c:\backup\*.*
_________________________________________________
When I try it in XP I get the error : can't create "backup 1/20/2000.zip"
This happens in XP for two reasons I discovered.
1. when using pkzip it truncates everything to 8 characters, even the files that it is compressing,
example:
when I wanted to zip a file called: "Verylongfilename.zip" it auto-truncated it to Verylong.zip
2. It doesn't like the "/" says its not a valid character (in win98 it auto-changed it to "-" and worked fine)
________
There was also a error I got (but couldn't replicate later) that it didn't like that in the bat file there was this value:
%%gdate1%%
If I shortened it to under 8 Characters it went through fine.
who know why it doesn't give me that problem now.
Anyways need help figuring this one out.
:disgust:
example:
backup 01-20-2000.zip
backup 01-21-2000.zip
backup 01-22-2000.zip
etc......
It works great under windows98 but when I tried it under XP it had problems.
Here is the bat file:
-----------------------------------------
:: gdate.bat (GetDATE)
@ECHO off
SET gdate1=
ECHO SET date=%%3>%temp%.\%%gdate1%%.bat
DIR/A-D/-W/L/-P %temp% | FIND "%%gdate1%%" >%temp%.\%%gdate2%%.bat
SET gdate1=%temp%.\%%gdate1%%
CALL %temp%.\%%gdate2%%.bat
SET gdate1=
DEL %temp%.\%%gdate?%%.bat
pkzip "c:\temp\backup %date%.zip" c:\backup\*.*
_________________________________________________
When I try it in XP I get the error : can't create "backup 1/20/2000.zip"
This happens in XP for two reasons I discovered.
1. when using pkzip it truncates everything to 8 characters, even the files that it is compressing,
example:
when I wanted to zip a file called: "Verylongfilename.zip" it auto-truncated it to Verylong.zip
2. It doesn't like the "/" says its not a valid character (in win98 it auto-changed it to "-" and worked fine)
________
There was also a error I got (but couldn't replicate later) that it didn't like that in the bat file there was this value:
%%gdate1%%
If I shortened it to under 8 Characters it went through fine.
who know why it doesn't give me that problem now.
Anyways need help figuring this one out.
:disgust: