Someone wrote the following program for me. What this does is it determines the day of the week and if it is AM or PM(time). It then finds a file and copies it over another file specified. In this case Startup.wav
My autoexec bat has the following lines in it:
SET WAVFROM=C:\WinWav\
SET WAVTO=C:\Winwav\Startup.wa
v
C:\getdaya.exe
__
The first SET statement tells the program what directory to find the Wav files in based on the day and if it is AM or PM.
The second SET statement tells the program where to write out the file (it actually copies the file it needs OVER startup.wav)
____
I want to eliminate the need for SET statements.
I really want to be able to add the lines to the program command line in the autoexec.bat file such as:
C:\getdaya.exe C:\WinWav C:\Winwav\Startup.wav
(perhaps an ending "\" is optional in C:\Winwav, do not know)
I actually have some other features but do not want to ask too much.
I will list it though..
Nice to have the ability where the program finds the proper file to copy from such as "mona" and ignores the extension (in this case WAV). It will read the extension type and then copy this OVER the file specified in the second parameter. However this file will also not have an extension listed. You will derive that from the first file.
Hence if I had a file mona.mp3, you might determine it is Monday morning and find the file that begins with "mona". You then would determine its extension is "mp3". Now you would copy this over the "StartUP" file name WITH the extension of "mp3".
If "Mona" really had a file name of "mona.ra", then you would end up creating startup.ra
Therefore in the second parameter I would leave off the extension....
Thanks, Peter
pcumming@carolina.rr.com
-Non VB programmer
-Am using this to generate different startup sounds and such depending on the day and AM or PM of the day.
-Could perhaps be used for other things in the future.
-Have a VB book but do not have VB installed. Thought someone could whip this out in about 30 minutes, I will test. Give big points.
___________________
Here is the program as is, the author is too busy to make these small changes for me:
DIM Today, Today$
DIM AmPm, AmPm$
Today = WEEKDAY(NOW)
AmPm = HOUR(NOW)
IF AmPm >= 12 THEN AmPm$ = "p" ELSE AmPm$ = "a"
CF$ = ENVIRON$("WAVFROM")
CT$ = ENVIRON$("WAVTO")
IF RIGHT$(CF$, 1) <> "\" THEN CF$ = CF$ + "\"
SELECT CASE Today
CASE 1: CF$ = CF$ + "sun" + AmPm$ + ".wav "
CASE 2: CF$ = CF$ + "mon" + AmPm$ + ".wav "
CASE 3: CF$ = CF$ + "tue" + AmPm$ + ".wav "
CASE 4: CF$ = CF$ + "wed" + AmPm$ + ".wav "
CASE 5: CF$ = CF$ + "thu" + AmPm$ + ".wav "
CASE 6: CF$ = CF$ + "fri" + AmPm$ + ".wav "
CASE 7: CF$ = CF$ + "sat" + AmPm$ + ".wav "
END SELECT
ShellCmd$ = "COPY " + CF$ + CT$ + " /Y"
SHELL ShellCmd$
SYSTEM