Link to home
Start Free TrialLog in
Avatar of SimonUK
SimonUK

asked on

Logging within a VBScript

Hi all

In another question here:

https://www.experts-exchange.com/questions/21858361/Work-on-files-in-subdirectories-batch-or-VBScript.html

JesterToo wrote me a script to carry out a specific mirror / convert routine.  What I'd like to do now is add log creation to it.  Ideally, the log should be in the format below (see original thread for this to make sense!)

Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Already converted, skipped
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Already converted, skipped
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Already converted, skipped
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Already converted, skipped
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Already converted, skipped
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Done!
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Done!
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Done!
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Done!
Date : Time -  \dd-mm-yy\hh-mm-ss.mp2  -  Done!

The log should be replaced each time the script is run (the batch file that calls the vbs will e-mail the log out, then delete or archive it somewhere else so technically, each time the script runs there shouldn't be an existing log - but if there is, just replace it).

Thanks...


Simon
ASKER CERTIFIED SOLUTION
Avatar of JesterToo
JesterToo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SimonUK
SimonUK

ASKER

Brilliant, as before!

Thanks again


Simon
You're welcome and thanks for the grade!

Regards,
Lynn
Avatar of SimonUK

ASKER

Pleasure !

There's a little problem.  The log works fine, it lists all skipped files and all converted files - but the script no longer actually performs the conversion on new files!  The new destination folders are created as expected - and the files to be converted appear in the process list and the log- but no mp3's appear...


Simon
I'm sorry, Simon... I introduced a careless mistake that you can easily fix.  About 9 lines up from the bottom of the script there is an "oShell.Run" statement.  I accidentally commented that line instead of the one two lines earlier that starts with "sCommand = cmd /c copy ...".  I had meant to comment out the lines I used for testing but flagged the wrong one here.

If you remove the apostrophes at the fron of that statement it will actually run the LAME program.  Let me know if you have any more problems with it.  The other line can be left asis if you like since very next line overwrites it anyway.

Lynn
Avatar of SimonUK

ASKER

Hi Lynn

Brilliant, all working perfectly now.  Many thanks !


Simon