Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script performing certain actions

Status
Not open for further replies.

koengi01

IS-IT--Management
Aug 27, 2003
9
DE
Hello,

Can anyone tell me if it's possible to make a script that opens a database, import a textfile, zip the textfile, move the zipfile to a directory and than delete the textfile.

The textfile,zipfile, database and directory names are always the same.

I want to click on the script so that all the actions are performed, without doing it manually each time.

Regards,

Koengi
 
Assuming the database import can be managed from the command line (ie, don't need to run a GUI app), then yes (winzip has a command line add on & there's plenty of other command line zip apps Moving zipfile & deleting text file are standard command line operations). Otherwise you'd also need some sort of record/replay mechanism to manage the GUI importing the text file too.
 
Thx Wolluf,

The import is running by a macro, so that's not a problem.
Do you have any examples about this?

regards

Koen
 
'import is running by a macro' - how is the macro invoked? You said open database/import textfile. Those operations both need to be specifiable by one or more command lines. Eg,

open test.db
import file.txt test.db
(close test.db)

or

dbimport file.txt test.db


Then, eg

wzzip file.zip file.txt
del file.txt

The zip app (see for winzip add on) can create the zipfile directly in the folder you want (so don't need to move it). If the filenames are always the same, you're presumably going to be overwriting the existing zipfile each time - you may need to supply a parameter to agree to overwrite (or you'll be prompted each time when you run the batch file)

Put all commands in a file and call it <something>.bat. You might want to out @echo off at the top to stop running commands displaying on the screen.

Double click on it to run (or create shotcut to it & double click that)
 
Thx Wolluf got it running and working!!!!

regards,

Koen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top