croezen
6th September 2006, 14:59
Hi,
I am trying to send a mail after the backup has finished and then i want to mail logfile of the backup.
so far nog problem, because i can do that with a simple commandline command.
BUT... the logfile-name changes everyday.
now i am trying to create a batchfile to find the correct filename and execute the command for that filename.
Hmm.. that's where the problems begin.

When i execute the command "dir /b /d /o-d" i get a list of names. I now need the first name in my command to send te mail.

some suggestions or maybe a better wat to accomplice this?

Han Brinkman
7th September 2006, 13:04
Eddy,

Exactly for this kind of 'questions' I am trying to convince my company to use linux/unix as OS instead of windows.
Batch scripting in dos is not so easy (but I have to confess that it depends with wich os you grew up ;-) ). For sure someone can tell us how to do this in a batch script.

If you are familiar with unix scripting you could install windows services for unix (from MS), or use similair free products like cygwin on your server in order to use a very simple shell script to solve your problem.

I don't want to start another flame around windows/unix but for me the windows services for unix makes my live a lot more simpler.

Regards,
Han

csterley
8th September 2006, 16:08
Not sure how your unix skill are, but you can always use gnu-tools for windows. They will give you some of the UNIX functionality from within your windows environment.

http://gnuwin32.sourceforge.net/