I'm teaching myself VB Script using online references and thought it would help to use it in creating a practical solution that can be used on our network.
I had the idea of creating a file that is run by the Windows Task Scheduler every morning at 7 a.m., checks the current system date and uses that information
to change the playlist that is used for our telephone system's hold music. This would automatically turn on Christmas music on the day after Thanksgiving, turn
on patriotic music around the 4th of July, etc.
A Shortcut to the every day/non-holiday music playlist (StandardHoldMusic.m3u) is stored in the user "holdpc" 's Startup folder so that it automatically
opens Winamp and starts playing when the user is logged in (done automatically every 30 minutes by a thin-client machine, to automatically clear any program hangs, etc.)
The logic in the script is to first delete the current playlist shortcut from the Startup folder.
Then the script assigns the every day/non-holiday music (StandardHoldMusic.m3u) to a variable as the default.
Then it cycles through a bunch of If Then clauses reassigning a different playlist if the current date falls within a holiday date range.
Finally it will write the shortcut to the Startup folder.
When executed I am getting the error code 800A01F5, Illegal Assignment "DestinationFile" at Line 61, Char 10.
For clarification purposes, the error seems to be occurring within the TEST section in which I'm using today's date to
test that it's working.
I'm sure it's a simple typo but I need another pair of eyes to check it.
The script is attached.