gzip on windows nt4 server batch file. No overwrite.

Hi ,
Nightly im copying over gz files from another server. Then uncompressing them with:
gzip -f -k -d c:\files\*.gz

If the folder already contains gz which it does , it overwrite the uncompressed file again each night ( i remove this on a regular basis but need to keep them for a week..)

When i remove the force swtich im asked to confirm yes/no for overwrite.

How do i build this into a Batch file?

Cheers!
LVL 1
stephengriffinAsked:
Who is Participating?
 
knightEknightConnect With a Mentor Commented:
@echo off
c:
cd c:\files
for /f %%F in ('dir/b *.gz') do @echo N | gzip -k -d %%F
0
 
stephengriffinAuthor Commented:
Hi , thanks v much , can you let me know which variables I need to change..

ie the dir/b .. does this relate to a specific dir?
0
 
knightEknightCommented:
in the script I set the current working directory to match the directory the files are in with this two lines:

  c:
  cd c:\files

change these as appropriate and the script should work as is.
0
 
knightEknightCommented:
^ should say "with THESE two lines:"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.