[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

gzip on windows nt4 server batch file. No overwrite.

Posted on 2008-06-13
4
Medium Priority
?
834 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 200 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

834 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