Solved

gzip on windows nt4 server batch file. No overwrite.

Posted on 2008-06-13
4
828 Views
Last Modified: 2013-12-28
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!
0
Comment
Question by:stephengriffin
  • 3
4 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 50 total points
ID: 21778362
@echo off
c:
cd c:\files
for /f %%F in ('dir/b *.gz') do @echo N | gzip -k -d %%F
0
 
LVL 1

Author Comment

by:stephengriffin
ID: 21778399
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
 
LVL 33

Expert Comment

by:knightEknight
ID: 21778444
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
 
LVL 33

Expert Comment

by:knightEknight
ID: 21778452
^ should say "with THESE two lines:"
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question