Solved

gzip on windows nt4 server batch file. No overwrite.

Posted on 2008-06-13
4
830 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Listening device 21 75
BgInfo help 5 57
Registry key for Explorer context menu controlling drives 7 17
how to demote a DC microsoft server 2016 13 31
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

685 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