Modify the following line as needed for your requirements:
strNewFileName = Mid(fil.Name, 9)
fil.Name = strNewFileName
lngCount = lngCount + 1
End If
Next
strTitle = “Files renamed”
strPrompt = lngCount & “ files in “ _
& strScriptPath & “ renamed”
MsgBox strPrompt, vbInformation, strTitle
Scheduling a Backup Script with the Windows Vista Task Scheduler ................................
If you want to run a script automatically at a regular interval, you can schedule it as a task in the
Windows Vista Task Scheduler. One such use is to make a backup copy of a database every day at
a specific time. The DailyDatabaseBackup.vbs script makes a dated backup copy of the sample
Northwind.mdb database every day at the specified time.
A VBS script run from the Windows Explorer can have spaces in its name, but if you
intend to run a script from the Task Scheduler, its name can’t contain spaces. You won’t
get an error when selecting the script, but when the Task Scheduler attempts to run it, you will get an
error and it won’t run.
Dim fso
Dim fil
Dim strPrompt
Dim strDBPath
Dim strDBName
Dim strDBNameAndPath
Dim strDBNameBackup
Dim strScriptName
Dim strScriptNameAndPath
Dim strBackupNameAndPath
strScriptName = WScript.ScriptName
strScriptNameAndPath = WScript.ScriptFullName
Modify the hard-coded path as needed for your system:
strDBPath = “E:\Documents\”
strDBName = “Northwind.mdb”
strDBNameAndPath = strDBPath & strDBName
MsgBox “Database name and path: “ & strDBNameAndPath
WARNINWARNINGG
Creating Standalone Scripts with Windows Script Host 17