Computing.Net > Forums > Programming > Batch FIle - Extract by Day

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch FIle - Extract by Day

Reply to Message Icon

Name: Tezdread
Date: June 12, 2004 at 07:09:14 Pacific
OS: NT4 / Win2k
CPU/Ram: na
Comment:

Hi,

I have this idea that I'd like to run passed you all to see if it's possible and hopefully get some help to achieve it :o)

The t--------
Each day a zipped file is copied to an NT4 File server, I logon to the domain in the morning using either NT4 or Win2k workstations, browse to my mapped drive to the directory where the zipped files are stored.

The files are named something like Mon_file.zip, Tues_file.zip through the week.

I then open the file in winzip and extract it to another directory based on the month and then rename to 1006.ext where the number is the previous days date.

Then I open MS Access, specify the new file name in the form and click Go, which runs a script that splits the file into two and outputs them to the same directory.
Task----------

Questions:

1. How can I check todays's date against the date of the zipped file and extract the relevant file?

I thought I could do something like
date /t
If date %DD%=Fri goto Fri
:Fri wzunzip Fri_****.zip \new\directory

But then when that didn't work I started doing some searches and found a few similar problems here but none of them help.

2. Because the zipped files and winzip are on different shared directories do I need to be logged in for the batch to work?

3. Would I have to be logged in to open MS Access?

4. Would the script have to be compatible with the NT4 server that it's run from? If so how would I specify the server\share location in the AT command?

There's a lot of info / questions here so I hope that's ok?

Any ideas?



Sponsored Link
Ads by Google

Response Number 1
Name: jagmafer
Date: June 17, 2004 at 06:21:30 Pacific
Reply:

That's a complex question, and i hope that i can at least point you in the right direction.
1.) Not sure exactly what problems you're running into, but does it make it to Fri ? Also, i believe you meant four ?'s not *'s - ?'s represent a single letter.
2.) You'll have to check the permissions yourself (the rw permissions)
3.) I'm guessing so, but i'm not sure.
4.) I'm not entirely certain i fully understand this last question. The script must be compatible with the actual machine that it's executing on. The server\share notation should be (i think) just the usual \\COMPUTERNAME\SHAREDFOLDER
You may have to look into a
net use p: \\COMPUTERNAME\SHAREDFOLDER
to get it to run from dos....
Hope this is of at least a little help...
~Jag


0

Response Number 2
Name: Tezdread
Date: June 21, 2004 at 15:43:45 Pacific
Reply:

Nice one Jag,

I forgot about the ? so that will help
the permissions should be ok
access wont run without being logged in
and good point about net use

Still have to get it working :-)


0

Response Number 3
Name: Tezdread
Date: July 16, 2004 at 18:01:26 Pacific
Reply:

Haven't got to far with this, I've tried to break it dow to help with my understanding but after readin quite a few sites with cmd info it's not sinking in to well.

can someone help get this part to work?

date /t
If %1%2%3%=Sat goto Sat
:Sat @echo Saturday

It should get the system date and if the first 3 charactors match Sat it will display hello but I've tried so many different ways I don't know what to do?

could some one explain please /?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch FIle - Extract by Day

Batch file. Extract single phrase f www.computing.net/answers/programming/batch-file-extract-single-phrase-f/16419.html

Problem creating batch file www.computing.net/answers/programming/problem-creating-batch-file/16908.html

Batch file input restriction www.computing.net/answers/programming/batch-file-input-restriction/19357.html